Run this in your browser's JavaScript console, then jQuery should be available...
(在浏览器的JavaScript控制台中运行它,然后jQuery应该可用...)
var jq = document.createElement('script');
jq.src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();
NOTE: if the site has scripts that conflict with jQuery (other libs, etc.) you could still run into problems.
(注意:如果站点上的脚本与jQuery(其他库等)冲突,您仍然可能会遇到问题。)
Update: (更新:)
Making the best better, creating a Bookmark makes it really convenient, let's do it, and a little feedback is great too:
(让最好的东西变得更好,创建一个书签确实很方便,让我们去做,一点反馈也很棒:)
- Right click the Bookmarks Bar, and click Add Page
(右键单击“书签栏”,然后单击“ 添加页面”)
- Name it as you like, eg Inject jQuery, and use the following line for URL:
(随意命名,例如注入jQuery,并使用以下行作为URL:)
javascript:(function(e,s){e.src=s;e.onload=function(){jQuery.noConflict();console.log('jQuery injected')};document.head.appendChild(e);})(document.createElement('script'),'//code.jquery.com/jquery-latest.min.js')
(javascript:(function(e,s){e.src = s; e.onload = function(){jQuery.noConflict(); console.log('jQuery injection')}}; document.head.appendChild(e); })(document.createElement('script'),'// code.jquery.com/jquery-latest.min.js'))
Below is the formatted code:
(以下是格式化的代码:)
javascript: (function(e, s) {
e.src = s;
e.onload = function() {
jQuery.noConflict();
console.log('jQuery injected');
};
document.head.appendChild(e);
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js')
Here the official jQuery CDN URL is used, feel free to use your own CDN/version.
(这里使用官方的jQuery CDN URL,请随意使用您自己的CDN /版本。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…