function getUrlParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }
URL: http://www.nishitvaghela.blogspot.com?page=2&size=10
getUrlParameterByName('page') = 2
No comments:
Post a Comment