在google搜索了下,要求如下改:
再写一个函数,譬如function loadFunc(){ myFunc(var1,var2) },然后window.onload = loadFunc;
使用匿名函数。onload =function(){myFunc(var1,var2)}请高手帮忙改下,我不懂js。请问下面的这里的onload要怎么改?是TINY.box里的一段代码,谢谢了。 fill:function(c,u,k,a,w,h){
if(u){
if(v.image){
var i=new Image(); i.onload=function(){w=w||i.width; h=h||i.height; TINY.box.psh(i,a,w,h)}; i.src=v.image
}else if(v.iframe){
this.psh('<iframe src="'+v.iframe+'" width="'+v.width+'" frameborder="0" height="'+v.height+'"></iframe>',a,w,h)
}else{
var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');
x.onreadystatechange=function(){
if(x.readyState==4&&x.status==200){p.style.backgroundImage=''; TINY.box.psh(x.responseText,a,w,h)}
};
if(k){
                  x.open('POST',c,true); x.setRequestHeader('Content-type','application/x-www-form-urlencoded'); x.send(k)
}else{
                  x.open('GET',c,true); x.send(null)
}
}
}else{
this.psh(c,a,w,h)
}
},