Many of us know here that making jQuery run on the right time has been
a bit of a hassle in the past, mainly due to how document.ready is
interpreted differently, and sometimes jQuery can fire when the DOM
isn't complete - so , all that nice jquery code you have will not be
able to work correctly.


It looks like this problem has existed for a long time ( discussion
about this same thing in 2006:
http://groups.google.com/group/jquery-en/browse_thread/thread/fbf619d536e87721/cdeeab2799895486?lnk=gst&q=document.ready#cdeeab2799895486
)

A partial solution is to use document.ready() at the bottom of the
page, to hopefully have it run last.
http://groups.google.com/group/jquery-en/browse_thread/thread/8570c3a4347c6592/3ad19fbc9b50649f?lnk=gst&q=document.ready#3ad19fbc9b50649f
This still gets borked if the user has the file in cache though, I
think.

The reason I bring this up is because the jquery I've been using has
problems running on ie6 all of the time, and confuses people who are
on the receiving end of the problem.

A navigation that will occasionally not fire:
http://cressaid.brettjamesonline.com/BVCI/BVCI/telco.html

 $(function(){
 $('a.choicelist').bind('click',
                                function()
                                {
// Actual code to run
                                })
 });

^--- I'm sure I could just use document ready here, right?
(OT, but I noticed that In internet explorer, the first line of any
product you choose is indented too - not sure what's the cause of
that.)



An example of jQuery code running in document.ready if anyone wants to
test the difference:
http://cressaid.brettjamesonline.com/BVCI/index.html

So I guess what we should do is, try and get a list of possible ways
to run jquery ( I know of  $(function(){  in a js block of code,
document.ready , and a very buggy window.onLoad() - Even if it will be
fixed in upcoming versions hopefully, I guess a lot of people will
still be running older versions of jQuery.

Reply via email to