- <html>
- <head>
- <script language='javascript'>
- <!--
- var xmlHttp;
- try
- {
- xmlHttp= new ActiveXObject("Msxml12.XMLHTTP");
- }
- catch(e)
- {
- try
- {
- xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- catch(e){
- try{
- xmlHttp=new XMLHttpRequest();
- }catch(e){}
- }
- }
- //
- xmlHttp.onreadystatechange=function(){
- if(xmlHttp.readState==4){
- if(xmlHttp.state==200){
- alert(xmlHttp.responseText);
- }
- else{
- alert(xmlHttp.status);
- }
- }
- }
- xmlHttp.open("get","test.htm");
- xmlHttp.send(null);
- -->
- </script>
- </head>
- <body>
- </body>
- </html>
AJAX异步提交的简单例子
最新推荐文章于 2025-07-23 13:59:28 发布