www.webdeveloper.com
Results 1 to 4 of 4

Thread: JQuery ready function did not work

  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Question JQuery ready function did not work

    Hello Guru!

    I have the following code. however, the code after the second "HELLO" comments line seems not get executed at all.

    However, if I move down the 2 lines between the 2 "HELLO"'s to the very bottom towards the end of the ready function, everything seems to work.

    Is anybody able to find out what could be the problem? It really baffles me.


    Code:
    $(document).ready(function () {
        menu_main('navl');
    
    //HELLO!!!!
    var sorter=new table.sorter("sorter");
    sorter.init("sorter",1);
    //HELLO!!!!
    
        var el = document.getElementById(DASH.Nav);
        var c1 = "current";
        $('#'+DASH.Nav).addClass(c1);
    
        $('#inav').find('a').removeClass('theone');
        $('#'+DASH.theone).addClass('theone');
    
        $('#data').css('width',$(window).width()-290);
        if ($('#cframe').height() < $(window).height()-125) $('#cframe').css('height',$(window).height()-125);
        $('#navl').css('height',$('#cframe').height());
    
    });

  2. #2
    Join Date
    Aug 2012
    Posts
    2
    Nobody knows ??

  3. #3
    Join Date
    May 2012
    Posts
    77
    Try using below. Also check to make sure you have jQuery script within your HTML.

    Code:
    $(function(){
    
    });//closing tag

  4. #4
    Join Date
    Aug 2012
    Posts
    15
    Hi, did you check if the DASH.Nav var was declared?

    Otherwhise it will throw an error. Try to see on opera or chrome if there is a warning on the console.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles