Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

how to remove # from url while using parent.location.hash

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii.......all

i have certain buttons on simple html page...nw i want to change the url on click over each button without refreshing the page...i.e the page should remain same only the url gets change.

actually i tried it by javascript using parent.location.hash and even the result which i get is perfect the only issue is that hash comes with the url.
consider an example........my home page is www.homepage.com/test

nw if i am using parent.location.hash="sitename/testingsite"

then the url changes to www.myhomepage.com/test#sitename/testingsite

nw the only issue is # i want to remove hash from that url ,please suggest me.
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you set the hash, the hash symbol will be there. if you want to remove that, that will be like changing the url which will refresh your page. What do you basically want to achieve??
 
vikas malviya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:If you set the hash, the hash symbol will be there. if you want to remove that, that will be like changing the url which will refresh your page. What do you basically want to achieve??






actuallly i have created a website in which all the data are store in index page..eg homepage,aboutus,contact ..and i fetched the data using ajax.since i am fetching the data through ajax the url is not changing..but i wanted to change the url without refreshing the page means as we click on aboutus the ajax will bring the page but at the same time the url should change to ABOUT US path.......is there any way ??
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic