2
我發現在bookmarklets中鏈接和加載jquery的例子,但無法找到jquery和jquery-ui都加載的情況。如何嵌套cdn加載jquery和jquery-ui在書籤中?
這裏是我的工作要點: link text 更新的以下要點是現在功能。
<a href='javascript:(function(e,a,g,h,f,z,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js";c.onload=c.onreadystatechange=function(){z=a.createElement("script");z.type="text/javascript";z.src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js";z.onload=z.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}}})(window,document,"1.4.4",function($,L){/*ENTER JQUERY-UI CODE HERE*/});'>CC</a>