XMLHttpRequest 异步处理Url的典型应用
2010-03-05 11:09
344 查看
<mce:script type="text/javascript" language="javascript"><!-- //申明对象实例 var xmlhttp = false; function getHTTPRequestObject() { try { // try legacy object first xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { // try IE implementation now xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { xmlhttp = false; } } if(!xmlhttp && typeof XMLHttpRequest!= 'undefined') { // we must be using a mozilla based browser // so create a native request object now xmlhttp = new XMLHttpRequest(); } } //获得一个XMLHttpRequest对象实例 getHTTPRequestObject(); if(xmlhttp) { //异步调用 xmlhttp.open("GET", "http://www.baidu.com", true); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4) { //引用返回结果 alert(xmlhttp.responseText); } } xmlhttp.send(null); } // --></mce:script>
相关文章推荐
- XMLHttpRequest 异步处理Url的典型应用
- XMLHttpRequest 异步处理XML典型应用
- XMLHttpRequest 异步处理XML典型应用
- XMLHttpRequest 异步处理Json格式数据的典型应用
- XMLHttpRequest 异步处理Json格式数据的典型应用
- 处理【异步调用XMLHTTPRequest.open时拒绝访问Javascript】
- Ajax 中的xmlHttpRequest.open对url的处理
- NSMutableURLRequest Http 请求 同步 异步
- JSP XMLHttpRequest动态无刷新及其中文乱码处理
- JSP中使用XMLHttpRequest动态无刷新及其中文乱码处理
- 异步调用XMLHttpRequest
- HTTP 通信, XML 解析, 通过 Hander 实现异步消息处理
- XMLHttpRequest.open(bstrMethod, bstrUrl, varAsync, bstrUser, bstrPassword)
- android HTTP 通信, XML 解析, 通过 Hander 实现异步消息处理
- ajax处理过程,ajax入门,XMLHttpRequest对象
- XMLHttpRequest处理xml格式的返回数据
- 谈谈采用哪种Ajax处理:UpdatePanel、AjaxPro、JQuery ajax、XmlHttpRequest
- AJAX-----07XMLHttpRequest对象的处理返回的JSON类型数据
- jquey XMLHttpRequest cannot load url.Origin null is not allowed by Access-Control-Allow-Origin
- html5 XMLHttpRequest 图片异步上传