//弹出隐藏层 var _closedtimer; function showAlert(str){ createAlertWindow(); $('.jpcontent').html(str); $('[name=popWindow]').css('display', 'block'); //设置提示框停留时间 5秒 _closedtimer = window.setTimeout("closePopAlert()", 5000); }; //关闭弹出层 function closePopAlert() { window.clearInterval(_closedtimer); $('[name=popWindow]').remove(); }; function checkLoginToken(){ $.ajax({ url:'/memty/MemAction_checkLoginToken.jspx', type: 'get', dataType:'html', cache: false, async:false, error: function(xhr){ showAlert("系统错误,请重新登陆"); }, success: function(data){ var r = eval('(' + data + ')'); if(r.flag==false){ showAlert(r.msg); } } }); } function checkRentLoginToken(){ $.ajax({ url:'/rent/RentMemAction_checkLoginToken.jspx', type: 'get', dataType:'html', cache: false, async:false, error: function(xhr){ showAlert("系统错误,请重新登陆"); }, success: function(data){ var r = eval('(' + data + ')'); if(r.flag==false){ showAlert(r.msg); } } }); } //ul li select方式的值获取 function setUlSelect(id,_value){ $('#'+id).val(_value); $('#'+id+'_ul li').each(function() { if($(this).attr('rel')==_value){ $('#'+id+'_key').val($(this).html()); } }); } //创建窗口 function createAlertWindow(){ $('#popWindow').remove(); $('body').append('
' +'
系统提示
' +'
' +'
' +'内容' +'
' +'
' +'' +'
' +'
' +'
'); } //判断型提示框 function initConfirm(str, fu){ $('#popWindow, #maskLayer').remove(); $('body').append('
'); $('body').append('
系统提示
'); $('#popWindow .jpcontent').html(str); $('#popWindow .save').bind("click", fu); $('#popWindow, #maskLayer').css('display', 'block'); }; //关闭弹出层 function closeAlert() { window.clearInterval(_closedtimer); $('#popWindow, #maskLayer').css('display', 'none'); }; //刷新验证码 function refleshcode(){ $('#picimg').attr('src', '/super/pages/login/image.jsp?_time=' + new Date()); } //搜集url地址参数 function getParameter(param) { var query = window.location.search;//获取URL地址中?后的所有字符 var iLen = param.length;//获取你的参数名称长度 var iStart = query.indexOf(param);//获取你该参数名称的其实索引 if (iStart == -1) {//-1为没有该参数 return ""; } iStart += iLen + 1; var iEnd = query.indexOf("&", iStart);//获取第二个参数的其实索引 if (iEnd == -1) {//只有一个参数 return decodeURI(query.substring(iStart));//获取单个参数的参数值 } return decodeURI(query.substring(iStart, iEnd));//获取第二个参数的值 }