当前位置:编程学习 > JS >>

function pop(url) { window.open(url); } 该javascript函数为什么调用没结果

<button onclick="pop("http://www.zhaoxi.net")">Go to</button> 像这样调用,点击按钮后没结果。
答案:<html>
<head>
<script type="text/javascript">
function open_win(url) 
{
window.open(url)
}
</script>
</head>
<body>
<input type=button value="Open Window" onclick="open_win('http://www.w3school.com.cn')" />
</body>
</html>
其他:改为 <button onclick="pop('http://www.zhaoxi.net');">Go to</button>

上一个:javascript 函数 参数
下一个:JavaScript中字符串赋值00的问题。

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,