如何在Firefox Scratchpad中使用jQuery?

瑞奇水坝

如何在Firefox Scratchpad中使用jQuery?
我有Firefox v54.0.1。

我在Google上进行了搜索,发现一些文章提到了Firefox Scratchpad内置jQuery的方式,但是这些文章是在Scratchpad首次发布时写回的。

http://www.davidhayden.me/blog/jquery-and-javascript-development-using-firefox-scratchpad

https://hacks.mozilla.org/2013/11/reintroducing-the-firefox-developer-tools-part-2-the-scratchpad-and-the-style-editor/

我最初只是尝试使用jQuery代码,而当它不起作用时,我将它放入CDN中。

任何建议表示赞赏!
谢谢!

Firefox Scratchpad截图

编辑:(添加了戴夫的建议)

Firefox Scratchpad截屏2

戴夫

您应该能够通过在暂存器的开头添加此代码来注入脚本元素。另外,您需要等待其加载,还需要在回调中运行代码

let jq = document.createElement("script");
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js";
jq.onload = function() {
  //your code here
};
document.body.appendChild(jq);

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章