弱弱的问一个关于ajax的菜鸟问题
本帖最后由 lqj127 于 2013-07-07 21:23:33 编辑
是一本书上的,但是自己敲出来之后实现不了。这个程序是单击页面上的按钮然后页面弹出一个窗口,并更改按钮上的值。
14.7.php:
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Insert title here
<script><br />
var xmlhttp_request=false;<br />
try{<br />
if(window.ActiveXObject){<br />
for(var i=5;i;i--){<br />
try{<br />
if(i==2){<br />
xmlhttp_request=new ActiveXObject("Micsoft.XMLHTTP");<br />
}else{<br />
xmlhttp_request=new ActiveXObject("Mscml2.XMLHTTP."+i+".0");<br />
xmlhttp_request.setRequestHeader("Content-Type","text/html");<br />
xmlhttp_request.setRequestHeader("Charset","gb2312");<br />
}<br />
break;<br />
}catch(e){<br />
xmlhttp_request=false;<br />
} <div class="clear">
</script>
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn