html5关于跳转页面的方法

<!DOCTYPE html>
<html lang="en">
<head>
<script language="javascript"><!--
    
    function old_page()
    {
        window.location = "http://www.baidu.com"
    }
    function replace()
    {
        window.location.replace("http://www.baidu.com")
    }
    function new_page()
    {
        window.open("http://www.baidu.com")
    }
// --></script>
</head>
<body>
<input type="button" onclick="new_page()" value="点我打开新窗口"/>
<BR />
<input type="button" onclick="old_page()" value="本页面跳转有返回"/>
<BR />
<input type="button" onclick="replace()" value="本页面跳转无返回"/>
</body>

猜你喜欢

转载自blog.csdn.net/milijiangjun/article/details/81060764
今日推荐