javascript动态加载方法
程序员文章站
2022-06-11 10:11:09
...
script language="javascript" type="text/javascript" var newopen = function(i) { return function() { location.replace("http://blog.csdn.net/ajaxchen_615"); } } if (window.attachEvent) //IE { document.getElementById("btnan").attachEvent("onc
var newopen = function(i)
{
return function()
{
location.replace("http://blog.csdn.net/ajaxchen_615");
}
}
if (window.attachEvent) //IE
{
document.getElementById("btnan").attachEvent("onclick",newopen("popo"));
}
else //FF 谷歌
{
document.getElementById("btnan").addEventListener("click",newopen("tyty"),false);
}
//可实现方法重载
function chens(a,b,c,d)
{
this.a=a==null?alert("a"):"chen";
b==null?alert("b"):"";
c==null?alert("c"):"";
document.write(this.a);
this.d==null?alert("d"):"";
}