Wednesday, 15 August 2012

javascript - How to remove index.php from to url with jquery? -



javascript - How to remove index.php from to url with jquery? -

i remove index.php url jquery

i seek code continuously reload page

$(document).ready(function(){ var href=document.location.href; if(href.indexof("index.php")){ document.location.href = href.replace( "index.php", "" ); } });

how remove , dont continuously reload page ?

you can utilize history object accomplish this.

history.pushstate(null,pagetitle,chageurl);

where pagetitle new page title if requires changed , changeurl new url want set

but remember not supported ie v <8

refer below links improve understanding on this:

modify url without reloading page http://www.w3schools.com/jsref/obj_history.asp https://developer.mozilla.org/en-us/docs/web/guide/api/dom/manipulating_the_browser_history

javascript jquery html

No comments:

Post a Comment