简体   繁体   中英

executing the javascript code in address bar

I really don't know whether i am supposed to ask such question here or not. But anyways,

I am trying to run the following javascript code on address bar*:

javascript:if ( document.getElementById('meebo') ) document.getElementById('meebo').style.display='none';

this meebo bar on any website is just an annoyance :x . Now the problem i am facing is, when i press return, it shows the page with only 'none' written on it. Try it on http://www.hongkiat.com any website having meebo bar installed on it.

Another problem is, i want this code to be executed every time any page is displayed. I think we can do this using greasemonkey, but i am sure there will be another easier answer.

*by saying run on address bar , i mean copy the above code and paste it to address bar and hit return.

您需要将其包装在一个函数中:

javascript:(function(){if(document.getElementById('meebo'))document.getElementById('meebo').style.display='none'})();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM