js 打开新窗口

来源:百度知道 编辑:UC知道 时间:2024/05/06 12:44:28
<li><a href="#" onclick="window.open('../untitled.htm','width=100,height=200','')">open new window</a></li>

哪儿写错了?
添加了javascript: 刷新页面点击以后提示 参数无效



如果用2楼的方法添加mm_openbrwindow,刷新点击提示,缺少对象。。。

...................................

但是如果就想在link中定义打开新窗口呢,不要外部的<script></script>要怎样写呢?

window.open 前面加个javascript:
即:javascript:windows.open(...

看看是不是这样的。
首先按下面的修改你的代码

<li><a href="#" onclick="MM_openBrWindow('../untitled.htm','','width=200,height=200')">open new window</a></li>

然后将下面的代码添加到HEAD标签里
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>