备份用
//无参数
javascript:(function(){alert("this is a test");})()
//有参数
javascript:(function(arg){alert(arg);})("this is argument.")
// 使用 void(),防止页面产生返回值,使页面刷新
javascript:void((function(){alert("this is a test");return 0;})())
// 改变某一元素的style样式
javascript:(function()
{
document.getElementsByTagName('body').item(0).style.cssText += '; transform:rotate(180deg);'
})()
//添加样式表style
javascript:void(
(function()
{
var e=document.createElement('link');
e.setAttribute('rel','stylesheet');
e.setAttribute('type','text/css');
e.setAttribute('href','http://img3.douban.com/css/packed_douban5789200023.css');
document.getElementsByTagName('head')[0].appendChild(e);
})
());
//添加div
javascript:void(
(function()
{
var e=document.createElement('div');
e.style.cssText+='width:100%;height:50px;background-color:#000;position:fixed;bottom:0px;opacity:0.6;';
document.getElementsByTagName('body')[0].appendChild(e);
})
());
//添加 javascript脚本
javascript:void(
(function()
{
var e=document.createElement('script');
e.setAttribute('type','text/javascript');
e.setAttribute('charset','UTF-8');
e.setAttribute('src','http://www.duitang.com/js/core/widget/collectit.js');
document.body.appendChild(e)
})
());
over