Hi, i use Javascript(AJAX) and want to change the addressbar Ex: http://mywebsite.com to http//mywebsite.com?web=info
+1
A:
You don't want ajax just do this:
window.location = "http://mywebsite.com?web=info";
Hogan
2010-10-03 01:15:17
+1
A:
you can not change the url without the page actually redirecting. You can however append a hashtag to the url.
http://mywebsite.com to http://mywebsite.com#something
See this question on StackOverflow.
http://stackoverflow.com/questions/2366481/attaching-hashtag-to-url-with-javascript
jhanifen
2010-10-03 01:15:32
No, i don't want to change hash, just ?web=info
Snoob
2010-10-03 01:23:22
@jhanifen : a "hashtag"? Isn't that something used in twitter? I believe in URLs that is called an anchor
Hogan
2010-10-03 01:24:22
Well obviously twitter has made the term hashtag associated with a tweet. But #something in a url is also referred to as a hashtag.
jhanifen
2010-10-03 01:27:10
@Snoob - You can not add ?web=info to the url without the page actually changing. If you don't mind the page changing then @Hogan's answer below is correct.
jhanifen
2010-10-03 01:28:04
This isn't true anymore, at least in webkit (and others as they evolve), see this question: http://stackoverflow.com/questions/3849758/what-is-this-technology-facebook
Nick Craver
2010-10-03 13:56:00
If you are only supporting "Good" browsers then that is definitely a possibility.
jhanifen
2010-10-03 16:27:52