1.PHP后台代码实现
function redirect($url) {
header('Location: ' . $url);
}
2.通过HTML代码实现
<head>
<meta http-equiv="refresh" content="5;url=hello.html">
</head>
3.通过js实现
/**
* 跳转
* @param {Object} url
* @param {Object} time
*/
function hrefTo(url, time) {
if (time == 0) {
window.location.href = url;
} else {
setTimeout("hrefTo('" + url + "',0)", time);
}
}