我根據這個網站建設bookmarlet:http://www.latentmotion.com/how-to-create-a-jquery-bookmarklet/如何通過一個變量在javascript
這是bookmarlet的代碼:
javascript:(function(){
var head=document.getElementsByTagName('head')0],
script=document.createElement('script');
script.type='text/javascript';
script.src='http://myserver.com/bookmarlet-remote.js?' + Math.floor(Math.random()*99999);
head.appendChild(script);
})();
void 0
我怎樣才能從bookmarlet傳遞變量(以上代碼),到bookmarlet-remote.js?
我試過後var myNewvar ='myValue',沒有成功,任何想法?
儘量不使用VAR創建變量。 – 2011-05-24 16:11:15