读书人

GraeseMonkey中引来脚本

发布时间: 2012-09-21 15:47:26 作者: rapoo

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);
??? }

读书人网 >Web前端

热点推荐