I have three javascript/jquery scripts and I need all of them. I am new in jquery so not able to add all three scripts. If I do all then one of them do not work. I need to put all three scripts into one.

<script type="text/javascript">
$(function(){

    // off

    $("#pgfor").twoitems({
        header: false
    });


    // off

    $("#city").single({
        header: false
    });


    // default
    $("#locality").multiselect({
        header: true
    });


    // off
    $("#roomtype").twoitems({
        header: false
    });


    // off
    $("#pricetype").twoitems({
        header: false
    });


    // off
    $("#price_value").multiselect({
        header: false
    }); 

});
</script>


<script type="text/javascript">
$(document).ready(function($){
    $('#mega-menu-tut').dcMegaMenu({
        rowItems: '3',
        speed: 'fast'
    });
});
</script>


<script>
        $(document).ready(function() {

            $('a[id^="edit"]').fancybox({
                'width'             : '48%',
                'height'            : '82%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe',
                onClosed    :   function() {
                    parent.location.reload(true); 
                }
            });

            $('a[id^="icard"]').fancybox({
                'width'             : '40%',
                'height'            : '40%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe',
            });

            $('a[id^="upload"]').fancybox({
                'width'             : '40%',
                'height'            : '40%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe',
            });

            $('a[id^="delete"]').fancybox({
                'width'             : '20%',
                'height'            : '20%',
                onStart     :   function() {
                    return window.confirm('Do you want to delete?');
                },
                onClosed    :   function() {
                    parent.location.reload(true); 
                }


            });

        });
    </script>

Are you saying this doesn't work?

<script type="text/javascript">
  $(document).ready(function() {
    $("#pgfor").twoitems({header: false});
    $("#city").single({header: false});
    $("#locality").multiselect({header: true});
    $("#roomtype").twoitems({header: false});
    $("#pricetype").twoitems({header: false});
    $("#price_value").multiselect({header: false}); 

    $('#mega-menu-tut').dcMegaMenu({rowItems: '3', speed: 'fast'});

    $('a[id^="edit"]').fancybox({
        'width'             : '48%',
        'height'            : '82%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe',
        onClosed    :   function() {
            parent.location.reload(true); 
        }
    });

    $('a[id^="icard"]').fancybox({
        'width'             : '40%',
        'height'            : '40%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe'
    });

    $('a[id^="upload"]').fancybox({
        'width'             : '40%',
        'height'            : '40%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe'
    });

    $('a[id^="delete"]').fancybox({
        'width'             : '20%',
        'height'            : '20%',
        onStart     :   function() {
            return window.confirm('Do you want to delete?');
        },
        onClosed    :   function() {
            parent.location.reload(true); 
        }
    });

  });
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.