/    Sign up×
Community /Pin to ProfileBookmark

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());

});[/CODE]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@javasonauthorAug 10.2012 — Nobody knows ??
Copy linkTweet thisAlerts:
@Jerrell_BAug 10.2012 — Try using below. Also check to make sure you have jQuery script within your HTML.

<i>
</i>$(function(){

});//closing tag
Copy linkTweet thisAlerts:
@MekatekAug 10.2012 — 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.
×

Success!

Help @javason spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...