开发者

to set value parent page's frame from popup

开发者 https://www.devze.com 2023-01-02 12:32 出处:网络
I want to set label\'s value from popup.But label is in frame and I dont know how to achieve it from popup.From parent page,i get this label by following javascript function.

I want to set label's value from popup.But label is in frame and I dont know how to achieve it from popup. From parent page,i get this label by following javascript function.

But when I use this function in popup page, I cant find t开发者_运维问答opframe.Do u have any solution about how to success it?

if (window.parent.document.getElementById('lbl')) 
{
    window.parent.document.getElementById('lbl').innerText = sender.getSelectedItem().get_text();
}
else
{ 
    window.parent.frames['topFrame'].document.getElementById('lbl').innerText = sender.getSelectedItem().get_text();
}


window.parent

refers to your popup-window itself.

Try

opener.frames['topFrame'].document.getElementById()

instead - 'opener' refers to your main-window out of a popup.


window.parent.top.frames.document works

0

精彩评论

暂无评论...
验证码 换一张
取 消