Created
February 10, 2012 10:18
-
-
Save mygoare/1788523 to your computer and use it in GitHub Desktop.
ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ajax原理 | |
ajax对象 | |
open()打开 open(method,url,true) the url -- a file on a server. | |
onreadystatechange | |
send() | |
GET方法在open()时即可发送信息体 | |
e.g. | |
xmlhttp.open("GET","demo_get2.asp?fname=Henry&lname=Ford",true); | |
而POST方法则是在send()方法中 | |
e.g. | |
xmlhttp.open("POST","ajax_test.asp",true); | |
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); | |
xmlhttp.send("fname=Henry&lname=Ford"); | |
参考URL:http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment