转自:http://www.jobui.com/mianshiti/it/jsp/4880/
原理 HTTP协议的异步通信
get
1 创建xhr对象
2调用open
3 get 请求 设置回调函数onreadystatechange = callback
4send
post
1 创建xhr对象
2调用open
3 调用setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”);
4 设置回调函数onreadystatechange = callback
4send
本文详细介绍了HTTP协议中GET和POST请求的异步通信过程,包括创建xhr对象、调用open方法、设置请求头及回调函数等关键步骤。
311

被折叠的 条评论
为什么被折叠?



