function Util() {} Util.formParams = function(_formId) { var nodes = $("#" + _formId).find("input[type='text'],input[type='password'],input[type='hidden'],input[type='radio']:checked," + "input[type='checkbox']:checked,textarea,select"); var params = {}; for (var i = 0; i < nodes.length; i++) { var e = $(nodes[i]); var name = e.attr("name"); if (params[name] == undefined) { params[name] = e.attr("value"); } else { params[name] += "|" + e.attr("value"); } } return params; }; Util.adminErrorTip = function(_case, _code) { if(_code == -1) { //超时 alert("连接超时, 请重新登录"); location.href = "/admin/"; return; } var tip = _case[_code]; alert(tip); }; Util.errorTip = function(_case, _code) { var tip = _case[_code]; alert(tip); }; Util.reloadCurrentPage = function() { var hash = location.hash; var forceIndex = hash.indexOf("&force"); if(forceIndex == -1) { location.hash = hash + "&force=" + new Date().getTime(); } else { location.hash = hash.substring(0, forceIndex) + "&force=" + new Date().getTime(); } };