//获取当前人(申请人)
var userName = parent.parent.window.getUserName();
//获取当前行的信息
var row = datagrid1.getSelected();
// 获取当前网址
var curWwwPath = window.document.location.href;
// 获取主机地址之后的目录,如: WebCourse/jsp/login/login.jsp
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
// 获取主机地址,如: http://localhost
var localhostPaht = curWwwPath.substring(0, pos);
// 获取带"/"的项目名,如:/WebCourse
var projectName = pathName.substring(0, pathName.substr(1).indexOf(’/’) + 1);
return (localhostPaht + projectName);
//获取当前时间 格式为YYYY-MM-DD
function getNowFormatDate(){
var date = new Date();
var seperator1 = “-”;
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if(month >= 1 && month <= 9){
month = “0” + month;
}
if(strDate >= 0 && strDate <= 9){
strDate == “0” + strDate;
}
var currentDate = year + seperator1 + month +seperator1 + strDate;
return currentDate;
}