How to load jQuery if it's not already loaded?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-05-06T18:37:34Z Indexed on 2010/05/06 18:58 UTC
Read the original article Hit count: 159

Filed under:
|

Hi

I'm working on a weather widget, so in order to optimize it i want to check if jQuery has been loaded in the page, if Not, the widget will load it from my website. Because not all the websites use jQuery. how to do that?

Example of how to put my widget:

<html>
blah blah blah
.................
<script src="http://www.xxx.com/weather.js"></script>
</body>
</html>

Thank you

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery