在项目中需要获取到ifarm下的地址,用到 top.location.href ,把类似的方法总结一下做个笔记:
- top.location.href 获取最外层的地址,也可以跳转或打开指定页;
- window.location.href 和 location.href 是当前页面跳转
- parent.location.href 获取上一层页面跳转
- window.open() 在网站上打开另外的一个网站的网页
- window.location() 只能在一个网站中打开当前网站的网页
本文介绍了使用JavaScript进行网页导航的多种方法,包括利用top.location.href获取最外层页面地址,window.location.href实现当前页面跳转,parent.location.href用于上一层页面跳转,以及window.open()和window.location()分别用于在新窗口打开网页和在同一网站内跳转。
在项目中需要获取到ifarm下的地址,用到 top.location.href ,把类似的方法总结一下做个笔记:

被折叠的 条评论
为什么被折叠?