纯HTML网址跳转和隐藏地址跳转
2020-04-14 13:35:10
admin
51
隐藏原地址跳转:
<html> <head> <title>Hello</title> </head> <frameset cols="100%,*"> <frame src="https://xxx.guodejun.com/test/"/> </frameset> </html>
网址直接跳转:
<script language="javascript" type="text/javascript"> window.location="http://www.xxxx.com/en/Product.aspx";; </script> //还可以用下方的几秒后的方式来做: <script language="javascript" type="text/javascript"> //window.location.href = 'http://www.xxxx.com/en/Product.aspx'; // 五秒以后再跳转 setTimeout("javascript:location.href='http://www.xxxx.com/en/Product.aspx'", 5000); </script>
还有一种是refresh可以几秒后的跳转:
<meta http-equiv="refresh" content="3;url='http://www.xxxx.com/en/Product.aspx'">
//上面代码加在<head>与</head>之间。
更多方式如下:
立即跳转 <?php header("location:1.php"); ?> 延迟跳转,1秒跳转 <?php header('Refresh:1;url=1.php'); ?> <?php sleep(3); header("location:1.php"); ?> js延迟跳转 setTimeout("window.location.href='1.php'",3000); window.location.assign('1.php'); js原窗口打开,不能后退 window.location.replace('1.php'); 三个参数:1、url地址;2、打开方式(例新页面_blank,_new,自身跳转_self);3、是新页面的样式等。 window.open('1.php',_blank,width=300px); HTML 3秒跳转 <meta http-equiv="refresh" content="3;url='1.php'"> 原地址刷新 1、history.go(0) 2、location.reload() 3、location=location 4、location.assign(location) 5、document.execCommand('Refresh') 6、window.navigate(location) 7、location.replace(location) 8、document.URL=location.href