1.开启一个新的窗口?

使用window.open("网址","_blank");

或者window.open("网址");默认开启一个新的窗口

 

 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 2 "http://www.w3.org/TR/html4/loose.dtd">
 3 <html>
 4 <head>
 5 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 6 <title>无标题文档</title>
 7 
 8     <script type="text/javascript">
 9     
10         function openBaidu(){//开启一个新的百度窗口
11         
12             //新窗口称为子窗口
13             //老窗口称为父窗口
14         
15             //window.open("http://www.baidu.com","_blank");
16             window.open("http://www.baidu.com");//默认开启一个新的窗口
17         
18         }
19     
20     </script>
21     
22 </head>
23 
24 <body>
25     <input type="button" value="百度" onclick="openBaidu()">
26 </body>
27 </html>
View Code

相关文章:

  • 2021-09-28
  • 2021-09-28
  • 2021-09-28
  • 2021-09-04
  • 2021-09-04
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2021-09-28
  • 2021-09-28
  • 2021-09-28
  • 2021-09-28
相关资源
相似解决方案