【发布时间】:2015-08-21 18:50:57
【问题描述】:
这是我的 HTML 代码:
<p style="align-content: center">
<A style="align-content: center" HREF="newpopup.html" onClick="return popup(this, 'stevie')">my popup</A><br>
</p>
<p align="center">
<input type="button" onclick="popup(this, 'about') " value="CLICK HERE">
</p>
还有 JavaScript:
function popup(mylink, windowname)
{
if (! window.focus)
return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
我的按钮“点击这里”弹出一个窗口,但它是空的。我希望我的按钮能够像上面的 URL 链接“我的弹出窗口”一样工作。
所以我想通过单击按钮在弹出窗口中打开newpopup.html 的内容。
我的弹出式 URL 链接工作正常,我希望按钮也能正常工作。
【问题讨论】:
标签: javascript jquery html css