Home  >  Article  >  Web Front-end  >  An improved version of javascript passing values ​​on different pages_javascript skills

An improved version of javascript passing values ​​on different pages_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:00:241312browse

In fact, the principle is also very simple. Also first judge the type attribute through getAttribute and capture the button. Then when the button onclicks, i is passed into the subpage through the url.

Copy code The code is as follows:

input1



input2


< input type="submit" />



Use slice for subpages Method to split the url. And use the window.opener method to capture the text box of the parent page and assign it. Everything is OK
Copy the code The code is as follows:

openWindow



For those who haven’t understood yet, just look at the schematic diagram

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