我正在尝试使用javascript打开弹出窗口。它适用于Chrome,但不适用于IE或Firefox。
这是我的头部代码:
<head>
<script type="text/javascript">
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=400,width=400,left=550,top=200,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
</head>
我的代码在正文部分:
<body>
<a href="javascript:newPopup('buy-now/ambush-jacket.html');" target="_new"><img src="images/banner/buy.gif"></a>
</body
&GT;
以下是该页面的链接: http://riverswest.com/riverswest-site/ambush-jacket.html
立即购买想要点击的图片。
答案 0 :(得分:2)
问题是你的目标=“”。如果您要使用javascript弹出代码,则不需要它。
这很好用:
<a href="javascript:newPopup('buy-now/ambush-jacket.html');"><img src="images/banner/buy.gif"></a>