首页 > Web开发 > 详细

How to make an HTTP request

时间:2016-09-13 13:41:33      阅读:284      评论:0      收藏:0      [点我收藏+]

https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started

In order to make an HTTP request to the server using JavaScript, you need an instance of a class that provides this functionality. This is where XMLHttpRequest comes in. Such a class was originally introduced in Internet Explorer as an ActiveX object called XMLHTTP. Then, Mozilla, Safari and other browsers followed, implementing an XMLHttpRequest class that supports the methods and properties of Microsoft‘s original ActiveX object. Meanwhile Microsoft has implemented XMLHttpRequest as well.

为了用JavaScript向服务器发送一个HTTP请求, 需要一个具备这种功能的类实例. 这样的类首先由Internet Explorer以ActiveX对象引入, 被称为XMLHTTP. 后来Mozilla, Safari 和其他浏览器纷纷仿效, 提供了XMLHttpRequest类,它支持微软的ActiveX对象所提供的方法和属性.

 

 

<script type="text/javascript">
<!--
    if(window.XMLHttpRequest){
        httpRequest = new XMLHttpRequest();
    } else if (window.ActiveObject)
    {
        httpRequest = new ActiveObject("Microsoft.XMLHTTP");
    }

//-->
</script>

 

How to make an HTTP request

原文:http://www.cnblogs.com/yuanjiangw/p/5867987.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!