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
WBOYOriginal
2016-05-16 17:40:48893browse

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
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
Previous article:Waterfall flow layout and automatic loading of implementation code_jqueryNext article:Waterfall flow layout and automatic loading of implementation code_jquery

Related articles

See more