what is the technical difference b/w xmlHttpRequest object and activeX Object of ajax [closed]

陌路散爱 提交于 2020-02-21 07:14:55

问题


Please give me answer of this question as early as possible


回答1:


ActiveX in general is a Windows feature. Old versions of IE supported the ability to use ActiveX controls inside the browser. However no other browser (or operating system) supports this feature.

The ActiveX Ajax object was a Microsoft-supplied ActiveX control, which was available to be used in early versions of IE. Again, it only worked in IE.

More recently, the web standards body came up with a similar feature which didn't require an ActiveX control. This is the XMLHttpRequest object. This is now supported by all browsers, including newer versions of IE.

In order to write Ajax code which supports all browsers in current use, you need to write it in a way that supports either of these technologies, because many people are still using the older versions of IE that support ActiveX but don't support the standard XMLHttpRequest object.

Where possible, your code should use the XMLHttpRequest object, and only fall back to the old-style ActiveX control as a last resort. In some cases (where you don't need to support older versions of IE) you can drop the ActiveX control entirely.

ActiveX as a technology in the browser is generally frowned upon as these days, as it has been the cause of many security issues, and breaks cross-browser compatibility. The Ajax control is just about the only ActiveX control still in common use.




回答2:


Have a look here and here. That should answer your question. Besides it's always recommended to use XMLHttpRequest.



来源:https://stackoverflow.com/questions/5064773/what-is-the-technical-difference-b-w-xmlhttprequest-object-and-activex-object-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!