javascript 事件返回值的传递问题

javascript 事件返回值的传递问题


30秒到达战场
浏览 445回答 2
2回答

千巷猫影

12345678910111213141516171819202122232425262728293031<html><head><script&nbsp;type="text/javascript">function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest)&nbsp;&nbsp;{// code for &nbsp; IE7+, Firefox, Chrome, Opera, Safari&nbsp;&nbsp;xmlhttp=new &nbsp; XMLHttpRequest();&nbsp;&nbsp;}else&nbsp;&nbsp;{// code for &nbsp; IE6, IE5&nbsp;&nbsp;xmlhttp=new &nbsp; ActiveXObject("Microsoft.XMLHTTP");&nbsp;&nbsp;}xmlhttp.onreadystatechange=function()&nbsp;&nbsp;{&nbsp;&nbsp;if &nbsp; (xmlhttp.readyState==4 && xmlhttp.status==200)&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("myDiv").innerHTML=xmlhttp.responseText;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;}xmlhttp.open("GET","/ajax/test1.txt",true);xmlhttp.send();}</script></head><body><div&nbsp;id="myDiv"><h2>Let &nbsp; AJAX change this text</h2></div><button&nbsp;type="button"&nbsp;onclick="loadXMLDoc()">通过 AJAX 改变内容</button></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript