注册 登录
编程论坛 jQuery论坛

函数调用问题

yaopeng0418 发布于 2010-09-01 16:25, 4392 次点击
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)
}

}
}
希望大家能帮忙解决一下
1 回复
#2
czg1236987412010-09-02 13:05
$(document).ready()......................
1