简体   繁体   中英

Can't access iframe using jQuery in another domain In IE8-11

I can't access iframe using jQuery in localhost or if i use another domain In IE8-11 .
i use Smart Demo-bar script it work perfectly on other browsers but in IE8-11 it must be in some domain or all function provide py Demo-bar break.

- i have try add an onload event to the iframe. (But this will only work if the source in the iframe is from the same domain.)
- Another solution i fond in stackoverflow convert jQuery to JS .

Please if there's way to fix this issues on IE i'll be Thankful.

Internet Explorer has a very restrictive set of rules regarding Cross-domain access (as you have just noticed). The sandboxing between the "host" page and the iframe is meant to prevent XSS attacks.

If you are trying to make an ajax call, jQuery provides the JSONP (JSON with padding) data type, just to circumvent Cross-domain restrictions

If you want to pass event or function calls, you will need a third-party plugin, here is a sample: http://calibrate.be/labs/cross-domain-iframe-communication

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM