0

Code:

window.location.href = "Posts?Category=" + sel;

How to get the value in Category page?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Sujay
  • 601
  • 1
  • 10
  • 19

1 Answers1

0

Try this:

    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));

http://jsfiddle.net/kL9DJ/

Andrew
  • 5,290
  • 1
  • 19
  • 22