<script>
function hp(obj,url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);}
</script>
<div><button name="buttonName" type="button" onclick="hp(this,'http://abc.com')">按钮</button></div>用按钮设置主业可以
我要是把函数添加到<body topmargin="0" onbeforeunload="hp(this,' http://abc.com')">中的onbeforeunload事件里就不行,为什么阿?
function hp(obj,url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);}
</script>
<div><button name="buttonName" type="button" onclick="hp(this,'http://abc.com')">按钮</button></div>用按钮设置主业可以
我要是把函数添加到<body topmargin="0" onbeforeunload="hp(this,' http://abc.com')">中的onbeforeunload事件里就不行,为什么阿?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货