静态页面传参

$(document).ready(function () {
	var request = {
		QueryString :
		function (val) {
			var uri = window.location.search;
			var re = new RegExp("" + val + "=([^&?]*)", "ig");
			return ((uri.match(re)) ? (uri.match(re)[0].substr(val.length + 1)) : null);
		}
	}
	var areaids = request.QueryString("areaid");
	var searchtexts = request.QueryString("searchtext");
	if (searchtexts == null) {
		return false;
	}
	searchtexts = ReplaceAll(searchtexts, "/", "%");
	searchtexts = decodeURI(decodeURI(searchtexts));
	$('#searchtext').val(searchtexts);
	$('#areaid').val(areaids);
	if (searchtexts != '' && !isValidChar(searchtexts)) {
		alert('搜索关键字含有非法字符,请检查!');
		return false;
	} else {
		$('#lptable').datagrid('options').queryParams = {
			"areaid" :
			areaids,
			"searchtext" :
			searchtexts
		};
		$('#lptable').datagrid("reload");
	}
	
});

你可能感兴趣的:(静态)