i want to use jquery ,the js from google works,but not work from http://localhost;
when i turn off the Noscript plugin, localhost script works;
how to fix this problem?
Code: Select all
// ==UserScript==
// @name test2
// @namespace test2
// @include *
// ==/UserScript==
(function() {
var load = function() {
var scriptTag = document.createElement('script');
scriptTag.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
// the code bellow does not work when the Noscript is on
// scriptTag.src = 'http://localhost/laji/jquery.min.js';
scriptTag.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(scriptTag);
load = function() {
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(load,100); }
else { $ = unsafeWindow.jQuery; main(); }
};
return load();
};
load();
function main(){
$("body").css("background-color","#000000") //let page background be black
}
})();