如何在新窗口中打开 [英] how to open in new window
本文介绍了如何在新窗口中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我还有一个问题:(
这是我的脚本
i have another problem :( this is my script
<script type="text/JavaScript">
function first()
{
var first = confirm("Are you sure you want to navigate away from this page?");
if (first)
window.location = "http://www.yahoo.com.sg"
else
window.close;
}
function second()
{
var second = confirm("Are you sure you want to navigate away from this page?");
if (second)
window.location = "http://www.google.com"
else
window.close;
}
</script>
<p><b>Click the following link to enter yahoo</b></p>
<p><a href="javascript:first()"title="Opens in an external website in a new window">yahoo</a></p>
<p><b>Click the following link to check google</b></p>
<p><a href="javascript:second()" title="Opens in an external website in a new window">google</a></p>
其犯规在新窗口中打开。
请我需要一些帮助。任何建议或推荐?
its doesnt open in a new window. please i need some help. any suggestion or recommendation?
推荐答案
尝试 窗口。打开
。这将打开一个新的窗口:
Try window.open
. This will open a new window:
window.open("http://www.google.com");
另请参阅:
这篇关于如何在新窗口中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文