> Also any <a href="javascript:foo()"> links that call jQuery related
> stuff can't be clicked before jQuery is fully loaded. Having the
> script towards the bottom can also mess that up.

You are mixing your Model-View-Controller together with such 'links'.
href="javascript: ..." is bad jQuery practice, and never recommended.
It does not degrade in any way for users who are not running
JavaScript.  Any events that have any jQuery related code should be
unobtrusively bound in $( function() { }); [jQuery's doc.ready fn]
with $(element).click( function() {}), etc.  That means no inline
onClick, onMouseover, etc in your HTML.

Also, make sure your jQuery ready function is placed *after* your
jQuery script, whether it's at the bottom of the page or top.  Note
that while you're doing dev, and constantly reloading, you may
experience weird issues with page refreshes and caching that will give
you "$ is not defined" errors, due to the browser loading the page in
the incorrect order.  However, under normal use I and my clients have
not experienced that problem.

jQuery can always be put safely at the bottom of the page, if the page
is designed with proper jQuery practices.  However, the reason to load
jQuery last is to show your users content as fast as possible -- if
your page is completely jQuery-dependent, you may want jQuery in the
head instead so jQuery can work on the content before the users sees
and interacts with it, at the expense of longer load times.

Also, I can't get your test page to throw an error.  I too am using FF
2.0.0.9 with Firebug.  I don't use YSlow, but I'm not seeing errors no
matter what I click or hover.

Charles
doublerebel.com

On Nov 6, 7:25 pm, DaveG <[EMAIL PROTECTED]> wrote:
> > If you click on one of the links, while it's loading that page if your
> > mouse moves over the other one it will raise the Javascript warning...
>
> I've seen this exact behavior with other tip libraries jQuery based, and
> others. I didn't fully track down the issue, but managed to minimize it
> by wrapping all 'inline' and attached javascript calls inside
> document.ready.
>
> The presumption at the time was that some script loading tags took
> longer to process, and were doing so whilst the page was building, and
> events firing.
>
> > And if so, I guess the fix is to include jquery in the <head> (as soon
> > as possible) and the rest can still be in the footer...
>
> In this case we loaded in the head, so if we have the same issue, that
> may not correct it.
>
> Of course we may have the same symptoms, but entirely different issues.
>
>   ~ ~ David

Reply via email to