Home  >  Article  >  Web Front-end  >  javascript不同页面传值的改进版_javascript技巧

javascript不同页面传值的改进版_javascript技巧

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

其实原理也很简单。同样先通过getAttribute判断type属性,捕捉到按钮。然后在按钮onclick时把i通过url传入子页面。

复制代码 代码如下:

input1



input2






子页面用slice方法对url进行切分。并使用window.opener方法捕捉到父页面的文本框,进行赋值。 一切就OK了
复制代码 代码如下:

openWindow






还没明白的朋友看一下原理图就知道了

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