jQuery代码文档小工具

我对jQuery的了解还不及MooTools,所以我相当依赖jQuery文档 。 当我查看其中包含jQuery代码的文章时,我会定期看到以前从未见过的功能,并希望了解更多信息。 烦人的是弹出一个新标签页并导航到文档。 我创建了一个JavaScript favelet / bookmarklet来为我完成此任务。

您所需要做的就是突出显示代码,单击favelet,然后为您完成搜索!

查看演示小 工具

JavaScript

(function()%7Bvar%20d=document,w=window,ds=d.getSelection,ws=w.getSelection,ss=d.selection,e=encodeURIComponent;t=(ws)%3Fws():(ds)%3Fds():(ss)%3Fss.createRange().text:'';t=(t.toString().length)%3Ft:prompt('Please select the code or type the term you would like to research.','');if(t)%7Ba='http://api.jquery.com/?s=';u=a+e(t);f=function()%7Bx=w.open(u,'nfx','scrollbars=1,toolbar=0,resizable=1,status=1,width=600,height=600');if(!x)w.location.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(f,0);else%20f();%7D%7D)();

不用担心代码混乱……它起作用了!

查看演示小 工具

您需要做的就是将小工具拖到书签/收藏夹工具栏上,您可以在任何网站上使用它! 查看演示进行测试。

翻译自: https://davidwalsh.name/jquery-bookmarklet

你可能感兴趣的:(jQuery代码文档小工具)