input onclick事件實現頁面跳轉


1.如果讓本頁轉向新的頁面則用:

<input type=button onclick=”window.location.href(‘連接’)“>

2.如果需要打開一個新的頁面進行轉向,則用:

<input type=button onclick=”window.open(‘連接’)“>

<input type=button value=刷新 onclick=”window.location.reload()“>

<input type=button value=前進 onclick=”window.history.go(1)“>

<input type=button value=刷新 onclick=”window.history.go(0)“>

<input type=button value=后退 onclick=”window.history.go(-1)“>

<input type=button value=前進 onclick=”window.history.forward()“>

<input type=button value=后退 onclick=”window.history.back()“>

后退+刷新

<input type=button value=后退 onclick=”window.history.go(-1);window.location.reload()“>

3.打開無邊框的新窗口
<input type=”button” name=”Submit2″ value=”確 定” onclick=”javascript:(”,”,’width=720,height=500,resizable=yes,scrollbars=yes,status=no’)” />

4.點擊按鈕彈出確認alert窗口
方式一:
<input type=”button” name=”Submit1″ value=”確定”
onClick=”alert(‘是否確認提交?’);= ”;return false;” >
方式二:
<input type=”button” name=”Submit2″ value=”確定”
onClick=”if (confirm(‘是否確認提交?’))= ”;return false;” >


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM