Ctx
来自ling
function getCtx(){
var curWwwPath=window.document.location.href;
var pathName=window.document.location.pathname;
var pos=curWwwPath.indexOf(pathName);
var localhostPaht=curWwwPath.substring(0,pos);
var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
return(localhostPaht+projectName);
}
function getNowMonth(){
var now_date = new Date();
var year = now_date.getFullYear();
var month = now_date.getMonth()+1;
var date_str = year+'-' + (month<10?('0'+month):month);
return date_str;
}
function isIE7(){
if(navigator.appName == "Microsoft Internet Explorer")
if(navigator.appVersion.match(/7./i)=='7.')
return true;
else
return false;
}
window.ctx = getCtx();