这个代码是输入帐号密码登陆成功之后的页面的js代码:
<script language="JavaScript">
<!--
var s = "";
s = document.domain;
window.zDomain = s;
var gSID = "MBoujIFRhqQAkJVj";
var gUID="netman8410@163.com";
var gUser = "netman8410";
var gCssStylePath = "http://mimg.163.com/jsstyle/cmcss/163_blue_s.css";
var gDomain = "163.com";
var cosnm = "normal_fj20m_nf_64m";
var netfdr_host = "http://wp.mail.163.com";
var netDiskPath = "/netfolder/servlet/nfapp/main_list.html?";
var cos_netfolder = "1";
if(cos_netfolder != "1"){
cos_netfolder = "0";
}
//-->
</script>
<!--上述代码是一些变量的初始化-->
<script language="JavaScript">
<!--
function fGetVersion()
{
var userAgent = window.navigator.userAgent.toLowerCase();
var AppName = "";
var Version = "";
var Sys = "";
if(userAgent.indexOf("msie")>-1){
AppName = "msie";
Version = userAgent.replace(/.+msie/gi,"").replace(/;.+/gi,"") - 0;
}else if(userAgent.toUpperCase().indexOf("firefox")>-1){
AppName = "firefox";
Version = userAgent.replace(/.+firefox\//gi,"").replace(/\(.*\)/g,"") - 0;
}else if(userAgent.toUpperCase().indexOf("netscape")>-1){
AppName = "netscape";
Version = userAgent.replace(/.+netscape\//gi,"").replace(/\(.*\)/g,"") - 0;
}
if((AppName == "msie" && Version < 5) || (AppName == "firefox" && Version <1) || (AppName == "netscape" && Version<7.2) || userAgent.indexOf("macintosh") != -1 || userAgent.indexOf("konqueror") != -1 || userAgent.indexOf("safari") != -1 || userAgent.indexOf("camino") != -1){
document.location.href = "http://mimg."+ gDomain +"/jsstyle/html/clientagenerror.htm";
}
}
fGetVersion();
window.onload = function(){
fGTO("indexFrame").src = "http://mimg."+ gDomain +"/jsstyle/html/gblank0606131756.htm";
fGTO("contentFrame").src = "http://mimg."+ gDomain +"/jsstyle/html/blankpage.htm";
fGTO("submitFrame").src = "http://mimg."+ gDomain +"/jsstyle/html/blankpage.htm";
fGTO("historyFrame").src = "http://mimg."+ gDomain +"/jsstyle/html/history_1.htm";
fGTO("debugFrame").src = "http://mimg."+ gDomain +"/jsstyle/html/blankpage.htm";
fGTO("jsFrame").src = "http://mimg."+ gDomain +"/jsstyle/html/globe0606131756.htm";
fGTO("addressFrame").src = "/coremail/fcg/ldvcapp?funcid=prtsearchres&sid=MBoujIFRhqQAkJVj&sortattr_N=&showlist=&ifirstv=&tempname=address/addrdata_ntes.htm&listnum=-1";
fGTO("userFrame").src = "/coremail/fcg/ldapapp?sid=MBoujIFRhqQAkJVj&funcid=opuserattr&optype=print&tempname=options/userattr.htm";
}
function fGTO(id){
return document.getElementById(id);
}
function unload(){
if( gDomain == "163.com"){
window.open ( "http://popme.163.com/ad/popwin720300_freemail163.html", "vip_720", "width=720,height=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}else if( gDomain == "126.com"){
window.open ( "http://popme.163.com/ad/popwin720300_freemail126.html", "vip_720", "width=720,height=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
}
//-->
</script>
1,第一部分的js代码作用是初始化一些变量.由系统后台动态生成.
2,fGetVersion()函数在上一次代码分析中已经出现,这里不在解释.这里的作用是当浏览器版本不支持当前代码时自动转向到相应的显示页面.
3,
window.onload = function()这样的写法是一种比较灵活的写法,便于使html与js更加独立.相当于在body标记里写上onload属性.在这里定义一个函数在页面加载时自动执行.
4,fGTO(id)函数相当于把document.getElementByID(id)简写.在上一个函数中fGTO("indexFrame").src之类几个地方是对对象src属性的直接操作,动态写入相应的内容,这里应用DOM对象.
5,unload()函数作用是在页面退出时弹出相应的页面.