var MAX_PERIOD = $('#MAX_PERIOD').val(); // 借款的最大期限
MAX_PERIOD=Trim(MAX_PERIOD,"g"); //带 g 是去除全局空格
MAX_PERIOD=Trim(MAX_PERIOD,""); //不带 g 是去除两端空格
function Trim(str,is_global)
{
var result;
result = str.replace(/(^s+)|(s+$)/g,"");
if(is_global.toLowerCase()=="g")
{
result = result.replace(/s/g,"");
}
return result;
}