帝国cms 网站例子,如何开发网站平台开发,中考管理系统登录网站,网站建设品牌公司推荐---恢复内容开始--- 当我们访问一个页面不存在的时候#xff0c;就会跳到404页面 一般网站都在在404页面中做一个处理#xff0c; 就是当用户3秒种内还没有任何操作的话#xff0c;就会自动跳转到其它页面 技术实现有两种方法 1. 在404页面中的header间加上 meta http-e…---恢复内容开始--- 当我们访问一个页面不存在的时候就会跳到404页面 一般网站都在在404页面中做一个处理 就是当用户3秒种内还没有任何操作的话就会自动跳转到其它页面 技术实现有两种方法 1. 在404页面中的header间加上 meta http-equiv”refresh” content”3;urlhttp://你跳转的网站” 2. 用户JS实现location !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd
html
head
meta http-equivContent-Type contenttext/html; charsetGBK
title404 Not Found/title
/head
bodyh1找不到指定的页面/h1span idtotalSecond3/span秒后自动返回
/body
script languagejavascript typetext/javascript
!--var second document.getElementById(totalSecond).textContent;if (navigator.appName.indexOf(Explorer) -1) //判断是IE浏览器还是Firefox浏览器采用相应措施取得秒数{second document.getElementById(totalSecond).innerText;} else{second document.getElementById(totalSecond).textContent;}setInterval(redirect(), 1000); //每1秒钟调用redirect()方法一次function redirect(){if (second 0){location.href http://要跳转的网站;} else{if (navigator.appName.indexOf(Explorer) -1){document.getElementById(totalSecond).innerText second--;} else{document.getElementById(totalSecond).textContent second--;}}}
--
/script
/html ---恢复内容结束--- 当我们访问一个页面不存在的时候就会跳到404页面 一般网站都在在404页面中做一个处理 就是当用户3秒种内还没有任何操作的话就会自动跳转到其它页面 技术实现有两种方法 1. 在404页面中的header间加上 meta http-equiv”refresh” content”3;urlhttp://你跳转的网站” 2. 用户JS实现location !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html
head
meta http-equivContent-Type contenttext/html; charsetGBK
title404 Not Found/title
/head
bodyh1找不到指定的页面/h1span idtotalSecond3/span秒后自动返回
/body
script languagejavascript typetext/javascript
!--var second document.getElementById(totalSecond).textContent;if (navigator.appName.indexOf(Explorer) -1) //判断是IE浏览器还是Firefox浏览器采用相应措施取得秒数{second document.getElementById(totalSecond).innerText;} else{second document.getElementById(totalSecond).textContent;}setInterval(redirect(), 1000); //每1秒钟调用redirect()方法一次function redirect(){if (second 0){location.href http://要跳转的网站;} else{if (navigator.appName.indexOf(Explorer) -1){document.getElementById(totalSecond).innerText second--;} else{document.getElementById(totalSecond).textContent second--;}}}
--
/script
/html 转载于:https://www.cnblogs.com/small-gray/p/5011948.html