Ajax 中的xmlHttpRequest.open对url的处理
2014-10-06 15:44
302 查看
注意此js 是直接写在jsp页面中,而非单独成一个独立的js文件。
xmlHttpRequest.open("GET",
url, true);中的url的要求:当当前页面的url 为http://localhost:8080/SpringControllerResponses/requestResponse/onlyJsp时,如果open
函数中的url 为采用相对url是”onlyBoolean”
则Ajax
所发生的完整的url
为:http://localhost:8080/SpringControllerResponses/requestResponse/onlyBoolean
而此有可能不是我们所需要的,可能会不存在。
然而采用绝对url
时,其url
是我们自己所确定的,其一定存在,如:url为http://localhost:8080/SpringControllerResponses/onlyBoolean
因此推荐当我们采用Ajax 来进行通信时,其url 地址最好写的是绝对的url 地址。
xmlHttpRequest.open("GET",
url, true);中的url的要求:当当前页面的url 为http://localhost:8080/SpringControllerResponses/requestResponse/onlyJsp时,如果open
函数中的url 为采用相对url是”onlyBoolean”
则Ajax
所发生的完整的url
为:http://localhost:8080/SpringControllerResponses/requestResponse/onlyBoolean
而此有可能不是我们所需要的,可能会不存在。
然而采用绝对url
时,其url
是我们自己所确定的,其一定存在,如:url为http://localhost:8080/SpringControllerResponses/onlyBoolean
因此推荐当我们采用Ajax 来进行通信时,其url 地址最好写的是绝对的url 地址。
相关文章推荐
- AJAX中同时发送多个请求XMLHttpRequest对象处理方法
- AJAX中同时发送多个请求XMLHttpRequest对象处理方法
- ajax处理过程,ajax入门,XMLHttpRequest对象
- AJAX-----07XMLHttpRequest对象的处理返回的JSON类型数据
- AJAX中同时发送多个请求XMLHttpRequest对象处理方法
- ajax XMLHttpRequest请求页面返回的值和ashx处理程序返回的值
- Ajax XMLHttpRequest对象的三个属性以及open和send方法
- Ajax XMLHttpRequest对象的三个属性以及open和send方法
- Ajax XMLHttpRequest对象的三个属性以及open和send方法
- AJAX中同时发送多个请求XMLHttpRequest对象处理方法
- AJAX中同时发送多个请求XMLHttpRequest对象处理方法
- tmp WEB 2.0中AJAX应用的详细探讨;xmlHttp.open("GET", url, true);
- Ajax XMLHttpRequest对象的三个属性以及open和send方法
- 谈谈采用哪种Ajax处理:UpdatePanel、AjaxPro、JQuery ajax、XmlHttpRequest
- XMLHttpRequest 异步处理Url的典型应用
- XMLHttpRequest 异步处理Url的典型应用
- AJAX中同时发送多个请求XMLHttpRequest对象处理方法
- AJAX-----06XMLHttpRequest对象的处理返回的XML类型数据
- ajax 请求二进制流 图片 文件 XMLHttpRequest 请求并处理二进制流数据 之最佳实践
- Ajax处理XML,XMLHttpRequest对象的创建和访问servlet并返回xml数据到页面展示