JS ActiveX Control Usage Description new ActiveXObject ()

Source: Internet
Author: User

The

 activex control is widely used on the Internet. They can add to the fun of browsing by providing video, animated content, and so on. However, these programs may have problems or provide you with unwanted content

What is an ActiveX control?   ActiveX controls are widely used on the Internet. They can add to the fun of browsing by providing video, animated content, and so on. However, these programs may have problems or provide you with unwanted content. In some cases, these programs can be used to collect information from your computer in ways you do not allow, to destroy data on your computer, to install software on your computer without your consent, or to allow others to remotely control your computer. With these risks in mind, you should install these programs without fully trusting the publisher.   What should you do when Windows blocks ActiveX controls from being installed?   You might not want to install the ActiveX control. Installing Windows blocked ActiveX controls is an extremely risky thing to do. If the Internet Explorer security setting is at the default level, and the ActiveX control does not have a valid digital signature, Windows blocks the ActiveX control from being installed.   A valid digital signature confirms the issuer's identity (the company, website, or person distributing the document) and confirms that the document has not been tampered with since it was signed. If the file does not have a valid digital signature, you cannot determine whether the file is actually from the source it declares, or if it has not been tampered with (for example, a virus may be inserted into the control). You should not open a file unless you trust the publisher and know that the content will be secure when the file is opened.   NOTE: The following sentence means to generate a related active object, according to the relevant browser version   XmlHttp = Newactivexobject (Aversions[i]);    This line of JS code produces a XMLHttpRequest object.     Parentheses inside is the name of the ActiveX plugin .    Complete should be written like this:      code as follows: Var xmlhttp;  function Createxmlhttprequest () {  if (window. ActiveXObject)   {  var aversions =["msxml2.xmlhttp.5.0", "msxml2.xmlhttp.4.0", "msxml2.xmlhttp.3.0", " MSXML2. XMLHttp "," Microsoft.XMLHTTP "]; FoR (int i=0;i<aversions.length;i++)   {  try  {  xmlHttp = new ActiveXObject (aversions[i));  return; }  catch (oerror)   { } }  else if (window. XMLHttpRequest)   {  xmlHttp = new XMLHttpRequest ();  return; }  throw new Error ("XmlHttp object Could not becreated. ");  }   Add: The reason for this is that different browsers support JavaScript differently. So XMLHttpRequest objects are produced in a different way. ie. he supports the ActiveX approach.   ["msxml2.xmlhttp.5.0", "msxml2.xmlhttp.4.0", "" MSXML2. xmlhttp.3.0 "," MSXML2. XMLHttp "," microsoft.xmlhttp "]; These are the versions of his ActiveX.   some browsers. Like Firefox, the browser itself has support for XMLHttpRequest. Browsers have built-in objects. So with "xmlHttp = new XMLHttpRequest (); "You can have   if (window. XMLHttpRequest) is to determine whether the browser has built-in XMLHttpRequest objects  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.