Ajax发送请求参数

GET请求:

- 请求参数拼接在URL中:queryString = “sample.jsp?username=iwa&password=ajax”

- 打开请求:xmlHttp.open( “GET”, queryString )

- 发送请求:xmlHttp.send( null )

POST请求:

- 请求参数单独拼接成queryString:queryString = “username=iwa&password=ajax”

- 打开请求:xmlHttp.open( “POST”, url )

- 设置请求头:xmlHttp.setRequestHeader( “Content-Type”, “application/x-www-form-urlencoded;” )

- 发送请求:xmlHttp.send( queryString )

ppt 文件大小:304KB