This method reloads the page,
I am adding the code which is url independent, this following code uses pageNo param from html code.
In the url for current page will be added with param page-no if not present else it will replace the value for page-no param value in quey param.
Please find the useful code below for above usage
function reloadPage(){
pageNo = $(“#pageNo”).val();
var curUrl = window.location.href;
var re = /page-no=[ ]*(\w)*&{0,1}/g;var matchedpattern = curUrl.match(re);
if( matchedpattern == null ) {
url = curUrl.split(“?”);
curUrl = url[0] + “?page-no=”+pageNo+(url[1] != ‘undefined’ ? ‘&’+url[1]: ”);} else {
curUrl = curUrl.replace(matchedpattern,”page-no=”+pageNo+”&”);
}window.location.href = curUrl;
}
Thanks for referring my blog. Leave your query or any suggestion in the comment box. Still you can leave your feedback & suggestion to admin@techiehints.com
