本文介绍了将值从Parent传递到Child(Open)窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将值从父窗口字段传递给子窗口字段。
我在打开popwindow后使用window.open(www.google.com);

How to pass value from parent to child window field.I use window.open("www.google.com");

我需要传递/设置在父窗口中键入的搜索值到子窗口(www.google.com)

after popwindow is opened i need to pass/set search value typed in parent window to child window(www.google.com)

推荐答案

使用window.open()方法设置引用:

Set a reference using the window.open() method:

var childWin = window.open("www.google.com" <etc.>);

然后将childWin视为一个完整的其他窗口。例如,

Then treat childWin as a whole other window. For example,

childWin.document.getElementById('searchField')

将为您提供ID为searchField的元素的引用。等等。冲洗并重复。

will give you a reference to an element with ID of "searchField". Etc. Rinse and repeat.

这篇关于将值从Parent传递到Child(Open)窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 07:01