embedded widget that relies of jquery, what if main page has jquery already loaded?
If I create a widget, where someon just links to:
www.example.com/my.js
which places a small widget on their website, and my widget relies on jquery, how can first check if is loaded already on the page?
what if 1.3.1 is lo开发者_JAVA百科aded and I require 1.4.2?
If I recall there is a function in jQuery "$().jquery" that returns the version. Or "jQuery.fn.jquery;"
To check for jQuery entirely do something like
if(typeof(jQuery) != "undefined") { Bla bla code }
精彩评论