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
asked May 6, 2010 at 18:37
CodeOverload
48.8k56 gold badges136 silver badges225 bronze badges
1 Answer 1
if (typeof window["jQuery"] == "undefined"){
// no jquery
}
answered May 6, 2010 at 18:53
andres descalzo
15k14 gold badges66 silver badges119 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js