Home >Web Front-end >JS Tutorial >Call JavaScript methods in parent page/child page in iframe

Call JavaScript methods in parent page/child page in iframe

高洛峰
高洛峰Original
2016-11-28 11:12:261447browse

Ming: Suppose there are 2 pages, index.html and inner.html. There is an iframe in index.html, and the src of this iframe points to inner.html.
What we have to do now is:
1. Call a js method on inner.html in index.html
2. Call a js method on index.html in inner.html

The implementation code is as follows:

index.html

1.
2.
3.
8.
9.
10.


11.This is index page.
12.
13.
14.

15.
16.
17.


inner.html

1.
2.
3.
8.
9.
10.


11.This is inner page.
12.
13.
14.

15.
16.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn