代码:
window.location.href = "Posts?Category=" + sel;
如何获取类别页面中的值?
代码:
window.location.href = "Posts?Category=" + sel;
如何获取类别页面中的值?
尝试这个:
function getURLParameter(name, urlsearch) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(urlsearch || location.search) || [ , "" ])[1].replace(
/\+/g, '%20'))
|| null;
}
var url = "Posts?Category=1134324";
alert(getURLParameter('Category', url));