- <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異步提交的簡單例子
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.