Firefox 插件:无法在 document.popup 中打开新页面
我有一个 Firefox 插件,可以打开 document.popup 窗口。当我单击弹出窗口中的链接时,我想调用一个 javascript 函数,该函数在弹出窗口本身中显示警报。当我尝试 onCLick(onY()); 时仅在我关闭弹出窗口后才会出现警报。
'<div id="SearchLiteDef-yahoo" style="'+
'font-family:arial; font-size: 12px; float: left; cursor: auto; background-color: #DDD; '+
'margin: 0 3px ' + margin + 'px; '+
'padding: 0 3px; -moz-border-radius: 2px; width: auto;' +
'height: ' + windowButtonHeight + 'px; '+
'font-size: 12px; '+
'line-height: ' + windowButtonTextSize + 'px; '+
'font-weight: bold"><a href="#" onClick="onY(document.popupNode);" style="text-decoration: none;">Y!</a></div>'+
''+
这是调用弹出窗口的部分。我想调用该函数
this.onY = function(e){
alert("Hello");
}
仅当我关闭弹出窗口时才会出现警报。我希望警报出现在弹出窗口内。
谢谢, 基兰
I have a firefox addon which opens a document.popup window. When I click a link within the popup, I want to call a javascript function which displays an alert within the popup itself. When I try onCLick(onY()); the alert comes only after I close the popup.
'<div id="SearchLiteDef-yahoo" style="'+
'font-family:arial; font-size: 12px; float: left; cursor: auto; background-color: #DDD; '+
'margin: 0 3px ' + margin + 'px; '+
'padding: 0 3px; -moz-border-radius: 2px; width: auto;' +
'height: ' + windowButtonHeight + 'px; '+
'font-size: 12px; '+
'line-height: ' + windowButtonTextSize + 'px; '+
'font-weight: bold"><a href="#" onClick="onY(document.popupNode);" style="text-decoration: none;">Y!</a></div>'+
''+
This is the section which calls the popup. I want to call the function
this.onY = function(e){
alert("Hello");
}
The alert comes only when I close the popup window. I want the alert to come inside the popup window.
Thanks,
Kiran
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题在于您尝试在弹出窗口中打开弹出窗口。 AFAIK 在任何给定时间只能有 1 个弹出窗口。
I think the problem is that you try to open a popup within a popup. You can only have 1 popup at any given time AFAIK.