My function to get query string is:
GetID: function(name) {
return decodeURI((RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1]);
},
And when I got a url:
http://localhost/testsite/testB.aspx?ID=12
and call this function Its return 12
.
But now my url pattern is change.
Current url pattern is:
http://localhost/testsite/testB.aspx/12
Now I try to change regex and replace ?
with /
and other things to get desire value 12
.
But I am not success.My knowledge about regex
is not so good so help to modify my regex to get desire value.Thanks.