<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function linkok( ){
question = confirm("你确认要转入吗?");

if (question==true){
window.location.href = "http://www.baidu.com";
target="_blank"
}
}</script>
</head><body>
<input type="button" value="按钮" onclick="linkok( )"/>
</body>
</html>
<br>如上,我想网页以新页面方式打开,要增加什么代码</br>

解决方案 »

  1.   

    window.open('aaa.html','新页面','height=随便,....')
      

  2.   

    楼上正解
    查找window.open() 
      

  3.   

    window.open 是有打开限制的又没有控制打开的窗口 我不知道 为什么不用A标签<a href='http://www.163.com' target='_blank' onclick='return confirm("你确认要转入吗?");' >按钮</a>
      

  4.   

    <a href='http://www.163.com' target='_blank' onclick='return confirm("你确认要转入吗?");' >
    <input type="button" value="按钮" />
    </a>
    按钮样式不好看,可以调整.