Does jQuery dispatch an event when it's attached to window?
So, yeah, does jQuery dispatch an event when it's attached to the window object?
I'm attaching a script through
- var s = document.createElement("script");
- s.type="text/javascript";
- s.src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";
- document.getElementsByTagName('head')[0].appendChild(s);
then I'm running a setTimeout to detect when jQuery is available
- var i = setInterval(function(){if (window.jQuery) {
- doStuff()
- }}, 30);
It would be much easier to do something like
- window.addEventListener("jQattached", doStuff);
Thoughts?