Home > Web Front-end > JS Tutorial > js implementation method of transferring the value of the control in the iframe to the main page control_javascript skills

js implementation method of transferring the value of the control in the iframe to the main page control_javascript skills

WBOY
Release: 2016-05-16 17:40:48
Original
895 people have browsed it

Now let’s look at the implementation of the code. First, let’s look at the code of a main interface

Copy code The code is as follows:



                                                                                                           d("id1").value=data;
                                                                                                    value="11" />
                                                                  ;






You can see that a JavaScript function implementation is defined on the main page, and the incoming data parameter is assigned to the input text control with ID id1.

Let’s look at an embedded b.html page code





Copy code
The code is as follows:



The embedded page mainly uses a button event to take out the value from an input text control in this page, and then through parent.GetData(data) just call the function on the main page to operate.



This is the effect before clicking the button. Now click the button to see the effect.


This achieves the effect of value passing
Related labels:
source:php.cn
Previous article:Waterfall flow layout and automatic loading of implementation code_jquery Next article:Very useful js calendar algorithm detailed code_javascript skills
Statement of this Website
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
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template