[注意]====求助,我的程序老是出错,请各位指点====[注意]
<P>求助,这段代码在网上抄的!怎么我拿来就用不了了!请各位前辈指点!<br><br><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a href="http://www.w3.org/TR/html4/loose.dtd" target="_blank" >http://www.w3.org/TR/html4/loose.dtd</A>"><br><html><br><head><br><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br><title>未命名</title><br><link href="tyle.css" rel="stylesheet" type="text/css"><br><STRONG><FONT color=#ff0000><script type="text/javascript"><br>var http_request=false;<br> function send_request(url){//初始化,指定处理函数,发送请求的函数<br> http_request=false;<br> //开始初始化XMLHttpRequest对象<br> if(window.XMLHttpRequest){//Mozilla浏览器<br> http_request=new XMLHttpRequest();<br> if(http_request.overrideMimeType){//设置MIME类别<br> http_request.overrideMimeType("text/xml");<br> }<br> }<br> else if(window.ActiveXObject){//IE浏览器<br> try{<br> http_request=new ActiveXObject("Msxml2.XMLHttp");<br> }catch(e){<br> try{<br> http_request=new ActiveXobject("Microsoft.XMLHttp");<br> }catch(e){}<br> }<br> }<br> if(!http_request){//异常,创建对象实例失败<br> window.alert("创建XMLHttp对象失败!");<br> return false;<br> }<br> http_request.onreadystatechange=processrequest;<br> //确定发送请求方式,URL,及是否同步执行下段代码<br> http_request.open("GET",url,true);<br> http_request.send(null);<br> }<br> //处理返回信息的函数<br> function processrequest(){<br> if(http_request.readyState==4){//判断对象状态<br> if(http_request.status==200){//信息已成功返回,开始处理信息<br> document.getElementById(reobj).innerHTML=http_request.responseText;<br> }<br> else{//页面不正常<br> alert("您所请求的页面不正常!");<br> }<br> }<br> }<br> function usercheck(obj){<br> var f=document.reg;<br> var newuser=f.newuser.value; ----------------------->提示说50行错误,"newuser"为空或不是对象.<br> if(newuser==""){<br> document.getElementById(obj).innerHTML=" <font color=red>用户名不能为空!</font>";<br> f.newuser.focus();<br> return false;<br> }<br> else{<br> document.getElementById(obj).innerHTML="正在读取数据...";<br> send_request('../include/reguser.php?newusername='+newuser);<br> reobj=obj;<br> }<br> }<br></script><br></FONT></STRONG></head></P><P><body><br><form action="/pp/new.php?id=245" method="POST" name="temp_account" id="temp_account"><br> <table width="526" border="0" align="center" cellpadding="1"><br> <tr> <br> <td width="71">用户名:</td><br> <td width="210"><STRONG><FONT color=#ff0000><input name="newuser" type="text" id="newuser" size="30" maxlength="50" onChange="usercheck('disuserinfo')" onBlur="usercheck('disuserinfo')"> <br></FONT></STRONG> </td><br> <FONT color=#ff0000><STRONG><td align="left" bgcolor="#FFFFFF" id="disuserinfo">请输入一个用户名!</td><br></STRONG></FONT> </tr><br> <tr> <br> </table><br> <input name="MM_aaa" type="hidden" id="MM_aaa" value="temp_account"><br></form><br></body><br></html><br></P>[attach]23451[/attach][em01]<br>
[align=right][color=#000066][此贴子已经被作者于2007-7-2 23:00:36编辑过][/color][/align]
页:
[1]
