IE8 jquery cross-domain problem solving

Source: Internet
Author: User

1.IE8 jquery cross-domain problem solving: Add the following code

Source Address: Https://github.com/dkastner/jquery.iecors/blob/master/jquery.iecors.js

(function (jQuery) {//Create the Request object//(this was still attached to ajaxsettings for backward compatibility ) JQuery.ajaxSettings.xdr = function () {return (window. Xdomainrequest? New window.  Xdomainrequest (): null);  }; Determine Support properties (function (XDR) {jquery.extend (Jquery.support, {iecors:!!  XDR});  }) (JQuery.ajaxSettings.xdr ()); Create Transport If the browser can provide an XDR if (jQuery.support.iecors) {Jquery.ajaxtransport (function (s      ) {var callback, XDR = S.XDR (); return {send:function (headers, complete) {xdr.onload = function () {var headers = {' Conte            Nt-type ': Xdr.contenttype};          Complete ($, ' OK ', {text:xdr.responseText}, headers);                    };            Apply Custom Fields if Providedif (s.xhrfields) {xhr.onerror = S.xhrfields.error;          Xhr.ontimeout = S.xhrfields.timeout;}          Xdr.open (S.type, S.url); // XDR have no method for setting headers O_o xdr.send ((s.hascontent && s.data) | | null);        }, Abort:function () {xdr.abort ();    }      };  }); }}) (JQuery);

 

2. IE8 Internet Options to enable cross-domain

IE8 jquery cross-domain problem solving

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.