首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

GraeseMonkey中引来脚本

2012-09-21 
GraeseMonkey中引入脚本var STK// Add jQuery??? (function(){??????? if (typeof unsafeWindow.STK

GraeseMonkey中引入脚本

var STK;

// Add jQuery
??? (function(){
??????? if (typeof unsafeWindow.STK == 'undefined') {
??????????? var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement,
??????????????? GM_JQ = document.createElement('script');
???
??????????? GM_JQ.src = 'http://stk.js';
??????????? GM_JQ.type = 'text/javascript';
??? ??? ??? GM_JQ.charset = 'UTF-8';
??????????? GM_JQ.async = true;
???
??????????? GM_Head.insertBefore(GM_JQ, GM_Head.firstChild);
??????? }
??????? GM_wait();
??? })();

// Check if jQuery's loaded
??? function GM_wait() {
??????? if (typeof unsafeWindow.STK == 'undefined') {
??????????? window.setTimeout(GM_wait, 100);
??????? } else {
??????????? STK = unsafeWindow.STK;
??????????? letsJSTK();
??????? }
??? }

// All your GM code must be inside this function
??? function letsJSTK() {
??? ??? alert(STK);
??? }

热点排行