How to load jQuery if it's not already loaded?
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:
<h开发者_StackOverflow社区tml>
blah blah blah
.................
<script src="http://www.xxx.com/weather.js"></script>
</body>
</html>
Thank you
if (typeof window["jQuery"] == "undefined"){
// no jquery
}
精彩评论