Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 19:00:24
Original
1311 people have browsed it

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

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!