1. 程式人生 > >html頁面跳轉方法

html頁面跳轉方法

1. window.open('url');

2. window.location.assign('url');//在本頁面視窗跳轉

    window.location.replace('url');

3. <!--定時轉到其他頁面 -->  

<meta http-equiv="refresh" content="5;url=index.html">   

4. a標籤直接跳轉

<a href="http://baidu.com">百度一下</a>  

5. 通過javascript中實現跳轉

window.location.href='index.html';  

6. js返回上一頁
window.history.go(-1);或者window.history.back(-1)

頁面間資料互動:

1. window.open('url');//不能跨域?

2. 運用cookie