» » iframe

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

iframe cross-domain communication

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

3 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

 

Javascript enable adaptive height in iframe

Author: bamboo06 on 1-01-2016, 14:37, views: 926

9 Work we encountered iframe embedded in a page highly adaptive problems. Because we do not know iframe content page will be loaded high, I do not want to appear ugly scroll bars on the page, this time we can use javascript to dynamically make iframe highly adaptive.
Javascript enable adaptive height in iframe

We are ready to face a home a.html, and page two for embedded iframe for iframeH.html and iframeH1.html, content can easily add your own, respectively, practical applications may be Background generated content.

Category: Javascript

 

Operate iframe by Javascript

Author: bamboo06 on 1-01-2016, 14:10, views: 734

1 Although we use iframe in web development is relatively small, but still has its worth using iframe scenes, such as embedded external advertising. In the process, we may use iframe will encounter many problems, such as parent-child window by value iframe, iframe highly adaptive, iframe cross-domain communication and so on.
Operate iframe by Javascript

In practical applications, we often direct access to the child window page element in the parent window and manipulate them. Today I'll use examples to introduce how to use javascript to interoperate between father and son window dom iframe object started working.

Category: Javascript