1
我的JavaScript弹出窗口有问题。我有两个窗口弹出功能:Javascript WIndows弹出功能冲突
第一个窗口弹出将打开一个新窗口包含页面URL
样子:
<a class="" onclick="kmt_contactFormPopup('http://uk.support.tomtom.com/app/ask',this)">[To the contact form..]</a>
function kmt_contactFormPopup(emailURL, aTag)
{
params = 'width=950px';
params +=',height=700';
params += 'screenX=250, screenY=80,';
params +='scrollbars=yes';
newwindow=window.open(emailURL,'name',params);
if (newwindow.focus) {newwindow.focus()}
}
第二个窗口弹出将抓住内容在此HTML页面中,并在弹出窗口中显示内容。
例如;
Collect the error log <a href="#BOX01" onclick="kmt_ShowBoxPopup('BOX01', this);"><strong>[Show me how..]</strong></a><br /><br />
<div id="BOX01" style="display:none">
<table cellspacing="0" cellpadding="0" border="0" style="background-color:#ffffff;">
</tr>
</table>
</div>
JavaScript的
function kmt_ShowBoxPopup(targetDivID, aTag)
{
var orgin_div_content=document.getElementById(targetDivID).innerHTML;
showBoxPopupWin =window.open("",'name','height=400,width=710,screenX=250,screenY=80, scrollbars=yes');
showBoxPopupWin.document.write (orgin_div_content);
if (window.focus) {showBoxPopupWin.focus()}
}
如果我运行联系形式弹出功能第一,然后我点击showBox功能。我在JavaScript中的错误消息:
权限遭拒,从 获取属性Window.document 43
行是这行代码
showBoxPopupWin.document.write (orgin_div_content);
我想有不同的弹出视窗。