<!DOCTYPE html> <html> <head> <title>浏览器对象</title> <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> </head> <body> <p>操作成功</p><br> <span id="qwer">5</span>秒后返回主页 <a href="javascript:back();">返回</a> <script type="text/javascript"> var i=5; function app(){ var b=document.getElementById("qwer") i--; b.innerHTML=i; if(i==0){ window.location.href="http://www.baidu.com";} } setInterval(app,1000) function bpp(){ window.history.back()} } </script> </body> </html>
24行代码有问题
charset=gkb改成charset=gb2312或者utf-8就不乱码了