懂web的同学帮忙看下这个页面是怎么回事

[复制链接]
查看11 | 回复2 | 2011-9-11 04:30:48 | 显示全部楼层 |阅读模式
auto.qq.com/a/20051110/000084.htm一打开就转到qq主页上了,是怎么实现的?他们为什么要这样做|?我想看这个页面的内容,就算保存到本地,依然是转到现在的主页上!我该怎么办?
回复

使用道具 举报

千问 | 2011-9-11 04:30:48 | 显示全部楼层
!DOCTYPEhtmlPUBLIC\"-//W3C//DTDXHTML1.0Transitional//EN\"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"htmlxmlns=\"http://www.w3.org/1999/xhtml\"xml:lang=\"zh-cn\"headmetacontent=\"text/html;charset=GB2312\"http-equiv=\"Content-Type\"title百年老车奥兹莫比尔(Oldsmobile)的兴衰/titlemetaname=\"keywords\"content=\"\"metaname=\"Description\"content=\"百年老车奥兹莫比尔(Oldsmobile)的兴衰\"linkhref=\"/css/autocss0607.css\"rel=\"stylesheet\"type=\"text/css\"/headbodydivid=\"ping\"scriptlanguage=\"javascript\"functionT(n){document.getElementById(\"ArticleCnt\").style.fontSize=n\"px\";}/scriptscriptlanguage=\"JavaScript\"functionqqping_url_build(){p=window.top.document.URL.indexOf(\"?\");if(-1==p)p=window.top.document.URL.indexOf(\"if(-1==p)address=\"u=\"window.top.document.URL;elseaddress=\"u=\"window.top.document.URL.substring(0,p);p=document.referrer.indexOf(\"?\");if(-1==p)p=window.top.document.referrer.indexOf(\"if(-1==p)refer=\"r=\"window.top.document.referrer;elserefer=\"r=\"window.top.document.referrer.substring(0,p);returnaddress\"}document.write(\"divstyle=\'position:absolute;left:0px;top:0px;width:0px;height:0px;z-index:0;visibility:hidden;\'imgsrc=\'http://ping.qq.com/ping?\"qqping_url_build()\"\'height=\'0\'width=\'0\'/div\");/script!DOCTYPEhtmlPUBLIC\"-//W3C//DTDXHTML1.0Transitional//EN\"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"htmlxmlns=\"http://www.w3.org/1999/xhtml\"headtitle404-1/titlemetahttp-equiv=\"Content-Type\"content=\"text/html;charset=gb2312\"/headbodystyle=\"margin:0;background-image:url(/404-1.gif);\"tablewidth=\"563\"border=\"0\"align=\"center\"cellpadding=\"0\"cellspacing=\"0\"trtdheight=\"125\"/td/trtrtdheight=\"195\"background=\"/1.gif\"bgcolor=\"#FFFFFF\"tableborder=\"0\"align=\"center\"cellpadding=\"0\"cellspacing=\"0\"trtdwidth=\"210\"ahref=\"#\"imgsrc=\"/404-2.gif\"alt=\"\"width=\"210\"height=\"80\"border=\"0\"//a/tdtdstyle=\"color:#333333;font-size:14px;font-weight:bold;\"页面没有找到,5秒钟之后将带您进入首页!/td/tr/table/td/tr/tablescriptfunctionjump(){if(document.title=\"404-1\")location.href=\"http://www.qq.com/?pgv_ref=404\";}setTimeout(\"jump()\",5000);/script/body/html!--[if!IE]|xGv00|44b93b76ce34b6df127f7443dd0880ee![endif]--/divstyle按照HTML规范来说,正常不会写两次的HTML和!DOCTYPEhtmlPUBLIC\"-//W3C//DTDXHTML1.0Transitional//EN\"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"从代码上来看就要么是有两层网页代码镶套了,这里要么这个是个废页,要么就是使用自动判断语句,在交互的时候出现了BUG,叠加到正常网页中去了。这里判断的JS代码是:scriptfunctionjump(){if(document.title=\"404-1\")location.href=\"http://www.qq.com/?pgv_ref=404\";}setTimeout(\"jump()\",5000);/script它的意思是,如果title之间的数值为:“404-1”的话,就跳转到首页,时间5秒。而你注意看,上面的headtitle404-1/titlemetahttp-equiv=\"Content-Type\"content=\"text/html;charset=gb2312\"/head就是404-1,所以,5秒后跳了。这样你就明白了,这是个自动判断跳转的JS。我个人估计可能是个BUG,别的程序判断误叠加到这个页面上了,不然实在没有道理这样去做。如果是远程的话,那就没有办法去改变它,如果是本地的话,有几种办法,改变title之间的数值,或者干脆删除,或者删除JS判断,都可以。
回复

使用道具 举报

千问 | 2011-9-11 04:30:48 | 显示全部楼层
就是一个自动跳转的JS代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行