» » cross domain

 
Sort articles by: Date | Most Rates | Most Views | Comments | Alphabet

iframe cross-domain communication

Author: bamboo06 on 1-01-2016, 23:52, views: 4015

5 As we all know, since the front end javascript to access cross-domain security restrictions made, javascript can only be accessed with the content of the document that contains it in the same domain. And when we encounter the actual code using iframe cross-domain access, Ajax cross-border communications and other operations, this time the problem of how to break cross-border operations, with examples of this article will tell solutions.
iframe cross-domain communication

At the same how different subdomains main domain javascript calls? This problem easy to solve, such as the existing primary domain and subdomains helloweba.com abc.helloweba.com, there is a page in helloweba.com embedded iframe pointing to a certain page abc.helloweba.com under, iframe page needs access helloweba. com this js the function code of the page, then the solution is: at the top of the two pages plus document.domain information.

Category: Javascript / HTML5