<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>弹跳事件</title>
<script language="javascript">
function openwindow()
{
window.open("http://www.sina.com.cn","window","width=300,height=200,status=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
}
</script>
</head><body onload=openwindow()>
<a href="http://www.baidu.com">百度</a>
</body>
</html>我想做的是在打开链接“百度”后弹出一个“新浪”窗口。可我现在做的却是在打开窗口还没打开“百度”,“新浪”就先打开了,那位大侠帮帮忙。我想做到的最终目的是:现在很多网站,在打开一个网站时会同时弹出另一个窗口。用JS来实现。各位大侠帮帮忙。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>弹跳事件</title>
<script language="javascript">
function openwindow()
{
window.open("http://www.sina.com.cn","window","width=300,height=200,status=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
}
</script>
</head><body onload=openwindow()>
<a href="http://www.baidu.com">百度</a>
</body>
</html>我想做的是在打开链接“百度”后弹出一个“新浪”窗口。可我现在做的却是在打开窗口还没打开“百度”,“新浪”就先打开了,那位大侠帮帮忙。我想做到的最终目的是:现在很多网站,在打开一个网站时会同时弹出另一个窗口。用JS来实现。各位大侠帮帮忙。
function openwindow()
{
document.location.href="http://www.baidu.com";
window.open("http://www.sina.com.cn","window","width=300,height=200,status=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>弹跳事件 </title>
</head>
<body>
<a href="http://www.baidu.com">百度 </a>
</body>
<script language="javascript">
myWindow=window.open("http://www.sina.com.cn","window","width=300,height=200,status=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
myWindow.focus();
</script>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>弹跳事件 </title>
<script language="javascript">
function openwindow()
{
document.location.href="http://www.baidu.com";
window.open("http://www.sina.com.cn","window","width=300,height=200,status=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
}
</script>
</head> <body>
<a href="#" onclick="openwindow()">百度 </a>
</body>
</html>
<script type="text/javascript">
open=window.open("http://www.sina.com.cn");
open.focus();
</script>
<body>
<a href="http://www.sina.com.cn">新浪 </a>
</body>
</html>楼主,就是这样的!祝你学习快乐啊