function pload(set, url) {
$("body").append("
" + "" + "
" + set + "
" + "
" + "
");
$("#tips").css("display", "block");
$("#line").css("display", "block");
$("#fp").css("display", "block");
$("#line").animate({
top : "+=5%",
opacity : 1.0
}, "slow");
}
function rpload(set, url) {
$("body").append("" + "" + "
" + set + "
" + "
" + "
");
$("#tips").css("display", "block");
$("#line").css("display", "block");
$("#fp").css("display", "block");
$("#line").animate({
top : "+=5%",
opacity : 1.0
}, "slow");
}
function encodeLink(url, para) {
var fullURL = url;
$.each(para, function(k, v) {
if (k % 2 == 0) {
if (k > 0) {
fullURL = fullURL + "&";
}
fullURL = fullURL + v + "=";
} else {
fullURL = fullURL + encodeURIComponent(v)
}
});
top.window.location.href = fullURL;
}
function encodeLinkNoHref(url, para) {
var fullURL = url;
$.each(para, function(k, v) {
if (k % 2 == 0) {
if (k > 0) {
fullURL = fullURL + "&";
}
fullURL = fullURL + v + "=";
} else {
fullURL = fullURL + encodeURIComponent(v)
}
});
return fullURL;
}
function chgLan(lan, url){
$.ajax({
type : "post",
url : url,//需要用来处理ajax请求的action,excuteAjax为处理的方法名,JsonAction为action名
data : {
"lan" : lan
},
dataType : "json",//设置需要返回的数据类型
success : function(data) {
location.reload(true);
},
error : function() {
alert("System Error");
}//这里不要加","
});
}
$(document).ready(function() {
reg1 = /[^\d.-]/g;
reg2 = /\./g;
$(".deicmal").keypress(function(e) {
if (!e.charCode)
k = String.fromCharCode(e.which);
else
k = String.fromCharCode(e.charCode);
if (($(this).val() + k).replace(reg1, "").length == $(this).val().length) {
e.preventDefault();
}
if (($(this).val() + k).match(reg2) != null && ($(this).val() + k).match(reg2).length > 1) {
e.preventDefault();
}
if (($(this).val().indexOf("-") == 0 && k.match("-")) || ($(this).val().length > 1 && k.match("-"))) {
e.preventDefault();
}
}).keydown(function(e) {
if (!e.charCode)
k = String.fromCharCode(e.which);
else
k = String.fromCharCode(e.charCode);
if (e.ctrlKey && (k == 'V' || k == 'v'))
e.preventDefault();
});
/*
* $(".numeric").keyup(function(){ reg1 = "!@#$%^&*()+=[]\\\';,/{}|\":<>?~`.- "; s = p.allow.split(''); for (i = 0; i < s.length; i++) if (p.ichars.indexOf(s[i]) != -1) s[i] = "\\" + s[i]; p.allow = s.join('|'); var reg = new RegExp(p.allow, 'gi'); var ch = p.ichars + p.nchars; ch = ch.replace(reg, ''); $(this).keypress(function(e) { if (!e.charCode) k = String.fromCharCode(e.which); else k = String.fromCharCode(e.charCode); if (ch.indexOf(k) != -1) e.preventDefault(); if (e.ctrlKey && k == 'v') e.preventDefault(); }); //$(this).val($(this).val().replace(/\D/g,'')); });
*/
});