I tried doing it using the method below. However because jQuery has not been defined I get a –
ReferenceError: jQuery is not defined
from Firefox.
I was hoping it would have been undefined and testable not error producing.
If I define a dummy variable like this var jQuery, then when I use jQuery I will always be using that blank variable due to scope look-up rules.
How do I detect when the jQuery global variable is ready?
// ... snip
if (jQuery) { // not defined - I guess different from undefined - always errors
// ...snip
or
However, the first version is more readable in my opinion and in a browser environment
windowis the global object sowindow.Xis pretty much equivalent to the globalX– except the fact that trying to access an undefinedwindow.Xwill not throw an error.