84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
认证高级PHP讲师
使用 _top 窗口,会整个页面跳转。
2.html <html> <head> <meta charset="UTF-8" /> </head> <a href="3.html" target="_top">aaa</a> </html>
还可以通过location.hash,location.search,cookie来保存最后的页面,都可以通过修改 1.html实现,其他页面不用改动。
1.html <html> <head> <meta charset="UTF-8" /> <script> window.onload = function(){ var iframe = window.frames['frame-page']; var domframe = document.getElementsByName('frame-page')[0]; //看你保存在哪,用改用什么方式读取,这里用 location.hash if( location.hash != "" ){ iframe.location.href = location.hash.substr(2); }; domframe.onload = function(){ //将 框架 内页面的 地址保存再 1.html中 location.hash = iframe.location.pathname; }; } </script> </head> <frameset> <frame src="2.html" name="frame-page"/> </frameset> </html>
点击3.html后,三种方式的区别:location.hash /1.html#/3.htmllocation.search /1.html?/3.htmldocument.cookie /1.html (不变)
如果都是用新的浏览器,都支持HTML5,还有localStorage、sessionStorage等地方可以保存,路径也是 /1.html不变。
使用 _top 窗口,会整个页面跳转。
还可以通过location.hash,location.search,cookie来保存最后的页面,都可以通过修改 1.html实现,其他页面不用改动。
点击3.html后,三种方式的区别:
location.hash /1.html#/3.html
location.search /1.html?/3.html
document.cookie /1.html (不变)
如果都是用新的浏览器,都支持HTML5,还有localStorage、sessionStorage等地方可以保存,路径也是 /1.html不变。