本文介绍了window.opener无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了一个window.opener返回一个值到父页面.我使用window.showModalDialog()打开了弹出窗口.我知道它进入了我的javascript函数,因为我发出了警报,警报弹出了. window.opener不会将值发送回我分配的文本框,它甚至都没有关闭.这是我的JavaScript代码(这是嵌入式JavaScript):
Hi,
I made a window.opener to return a value to the parent page. I used window.showModalDialog() to open the pop up. I know that it goes to my javascript function since I put an alert and the alert pops up. The window.opener does not send the value back to the textbox that I assigned and it does not even close. Here is my javascript code (this is an inline javascript):
<script language="javascript" type="text/javascript">
function SelectAndClose()
{
txtValue = document.getElementById('_browseTextBox').value;
//window.returnValue = txtValue.value;
window.opener.document.getElementById('txtRaw').value = txtValue;
self.close;
alert("Hello");
//return false;
}
</script>
这是我对此javascript的函数调用:
Here is my function call to this javascript:
<asp:Button ID="_selectButton" Text= "OK" runat="server" Width="138px" OnClientClick="javascript:SelectAndClose()"/>
谢谢!
Thanks!
推荐答案
这篇关于window.opener无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!