如何在html中的两个窗口之间传递参数[父窗口和子窗口之间的值]

问题描述:

描述: 我正在使用java脚本 我无法使用dom对象进行检索。如何在html中的两个窗口之间传递参数[父窗口和子窗口之间的值]

+1

解释更多。你想要什么?你尝试过什么?你研究了什么? –

+1

你好朋友据我所知,你正试图在父窗口和子窗口之间传递值。如果是这种情况,我知道一种方法。 –

从父窗口 尝试这个 在第一取回值将使用

If you open child using 
    popupWindow = window.open("my.html",'some name','width=500,height=500'); 

      In Child window: 


       //This gives DOM value of parent in child window. 
        window.opener.document.getElementById("your field name in parent window"); 



     //setting value 
     window.opener['dataitem'] = document.getElementById("your field name in child window").value; 

在父窗口:

    //This gives DOM value of child in parent window. 
       var some_data = window['dataitem']; 

希望这可以帮助你! 谢谢..