0

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

1 Answer 1

1
if (typeof window["jQuery"] == "undefined"){
 // no jquery
}
answered May 6, 2010 at 18:53
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.