1、history.go() 最常用的一种方法,可以返回、前进任意一步的页面、回到上一页 // 回到上一页 window.history.go(-1); // 回到下一页 window.history.go(1); // 回到任意一页 widnow.history.go(+前进几页) 2、history.back() back() 方法可加载历史列表中的前一个 URL(如果存在)。 调用该方法的效果等价于点击后退按钮或调用 history.go(-1)。 // 回到上一页 hist
欢迎您来到LeafCMS
JS-
-
有时候需要把网页强制切换成HTTPS,即使用户已经访问了HTTP的版本。原因可能是你不想让用户使用HTTP来访问,因为它不安全。要做到这个很简单,如果不想用PHP或者Apache的mod_rewrite来做这件事,用Javascript也可以。代码如下: <script type="text/javascript"> var targetProtocol = "https:"; if (window.location.protocol != targ
-
1、跳转链接 在当前窗口打开 window.location.href="http://www.a.com" 等价于 <a href="a.com" target="_self">go baidu</a> 2、跳转链接 在新窗口打开 window.open("http://www.a.com") 等价于 <a href="a.com" target="_


