How to use JavaScript to enable ifram to access each other and communicate with PHP?

Source: Internet
Author: User
This article mainly introduces the example of using JavaScript to enable ifram to access each other and communicate with PHP. It also provides a detailed demonstration of the access between the same domain. For more information, see Mutual access between iframe and the main framework

1. Mutual access between the same domain

Assume that both a.html and B .html domain are localhost (same domain)
In A.html, iframe is embedded into B .html, name = myframe
A.html has js function fMain ()
B .html has js function named rame ()
A.html needs to be implemented to call B .html's javasrame(example, B .html calls A.html's fMain ()

A.html

     
   Main window   

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.