Reputation: 48485
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
Upvotes: 0
Views: 733
Reputation: 14967
if (typeof window["jQuery"] == "undefined"){
// no jquery
}
Upvotes: 1