簡體   English   中英

簡單的javascript頁面按鈕導航g

[英]Simple javascript page button navigationg

不知道為什么這不起作用。 http://jsfiddle.net/PXrzh/

<button onclick="go()" >go</button>

js

function go() {
   window.location.href = "Confirmation.html";
}
<html>
    <script type="text/javascript">
        function go() {
            window.location.href = "Confirmation.html";
        }
    </script>
    <body>
        <button onclick="go()" >go</button>
    </body>
</html>

沒發現問題...

更新

index.js

function go() {
    window.location.href = "Confirmation.html";
}

index.html

<html>
    <script type="text/javascript" src="index.js"></script>
    <body>
        <button onclick="go()" >go</button>
    </body>
</html>

仍然沒有問題...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM