js實現(xiàn)頁面跳轉(zhuǎn)的幾種方法小結(jié)
按鈕式:
<INPUT name="pclog" type="button" value="GO" onClick="location.href='http://www.dbjr.com.cn/'">
鏈接式:
<a href="javascript:history.go(-1)">返回上一步</a> <a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
直接跳轉(zhuǎn)式:
<script>window.location.href='http://www.dbjr.com.cn';</script>
開新窗口:
<a href="javascript:" onClick="window.open('http://www.dbjr.com.cn/blog /guestbook.asp','','height=500,width=611,scrollbars=yes,status=yes')"& gt;布丁足跡</a>
第一種:
<script language="javascript" type="text/javascript"> window.location.href="login.jsp?backurl="+window.location.href; </script>
第二種:
<script language="javascript"> alert("返回"); window.history.back(-1); </script>
第三種:
<script language="javascript"> window.navigate("top.jsp"); </script>
第四種:
<script language="JavaScript"> self.location='top.htm'; </script>
第五種:
<script language="javascript"> alert("非法訪問!"); top.location='xx.jsp'; </script>
=====j(luò)avascript中彈出選擇框跳轉(zhuǎn)到其他頁面=====
<script language="javascript"> <!-- function logout()...{ if (confirm("你確定要注銷身份嗎?是-選擇確定,否-選擇取消"))...{ window.location.href="logout.asp?act=logout" } } --> </script>
=====j(luò)avascript中彈出提示框跳轉(zhuǎn)到其他頁面=====
<script language="javascript"> <!-- function logout()...{ alert("你確定要注銷身份嗎?"); window.location.href="logout.asp?act=logout" } --> </script>
以上這篇js實現(xiàn)頁面跳轉(zhuǎn)的幾種方法小結(jié)就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
在Js頁面通過POST傳遞參數(shù)跳轉(zhuǎn)到新頁面詳解
這篇文章主要給大家介紹了關(guān)于在Js頁面通過POST傳遞參數(shù)跳轉(zhuǎn)到新頁面的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2017-08-08js 去掉空格實例 Trim() LTrim() RTrim()
js 去掉空格實例Trim(),LTrim(),RTrim() 需要的朋友可以過來參考下,希望對大家有所幫助2014-01-01openLayer4實現(xiàn)動態(tài)改變標(biāo)注圖標(biāo)
這篇文章主要為大家詳細介紹了openLayer4實現(xiàn)動態(tài)改變標(biāo)注圖標(biāo),文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2020-08-08原生Js與jquery的多組處理, 僅展開一個區(qū)塊的折疊效果
同一個頁面, 有多組(不固定), 每組區(qū)塊數(shù)量不一定一樣的小區(qū)塊. 要求每次只展開一個區(qū)塊,需要的朋友可以參考下。2011-01-01