美文网首页
console引入jQuery的方法

console引入jQuery的方法

作者: 李天火 | 来源:发表于2016-04-16 14:43 被阅读948次

来自时鹏亮的blog
直接头部加入如下的代码就可以了:

// ==UserScript==
// @name           Marathon's World-RunKeeper Plugin
// @namespace      darkthread.net
// @include        http://www.marathonsworld.com/app/training.php?*
// @require        http://ajax.aspnetcdn.com/ajax/jQuery/jQuery-1.7.2.js
// ==/UserScript==

这方法来自:http://blog.darkthread.net/post-2012-05-05-Greasemonkey-load-jQuery.aspx

值得称赞,因为我不知道为什么原始的这个办法失效了(注意下面的代码我测试失效了哦!):

var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.aspnetcdn.com/ajax/jQuery/jQuery-1.7.2.js';
GM_JQ.type = 'text/JavaScript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);

相关文章

网友评论

      本文标题:console引入jQuery的方法

      本文链接:https://www.haomeiwen.com/subject/gfxolttx.html