yaopeng0418 发表于 2010-9-1 16:25

函数调用问题

Response.Write("<div  id='me' style='background-color:#FFFFFF;' onMouseOver='this.style.background-color='#F0F5F8';'  onMouseOut='this.style.background-color='#FFFFFF''><a href=# style='margin-left:8px;'><img src="&rs4("hpicture")&" name="&session("name1")&"  onclick='send(this.name);' onLoad='head(this.name,this)'  align='absmiddle' style='border:0px solid #CCFFFF;' onMouseOut='this.width=40;this.height=40' onMouseOver='DrawImage(this)' width='40' height='40'></a>div>")
但是onload没反应,head函数如下:
function head(name,hpic){
alert(pic);
window.setTimeout("head(name,hpic)",50);
createXMLHttpRequest();
xmlhttp.onreadystatechange=onhback(hpic);
var url="pic.asp?name="+escape(name);
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-encoded");
xmlhttp.send(url);
}

function onhback(hpic)
{
if(xmlhttp.readyState==4)
{
if(xmlhttp.status==200)
{
  var cont=unescape(xmlhttp.responseText);
  $(hpic).attr("src",cont)
}

}
}
希望大家能帮忙解决一下

czg123698741 发表于 2010-9-2 13:05

$(document).ready()......................

页: [1]

编程论坛