i use Javascript(AJAX) and want to change the addressbar Ex: http://mywebsite.com to http//mywebsite.com?web=info
Asked
Active
Viewed 861 times
0
-
Do you really know what [AJAX](http://en.wikipedia.org/wiki/Ajax_(programming\)) is? – vol7ron Oct 03 '10 at 02:36
2 Answers
3
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.
-
-
@jhanifen : a "hashtag"? Isn't that something used in twitter? I believe in URLs that is called an anchor – Hogan Oct 03 '10 at 01:24
-
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 Oct 03 '10 at 01:27
-
@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 Oct 03 '10 at 01:28
-
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 Oct 03 '10 at 13:56
-
If you are only supporting "Good" browsers then that is definitely a possibility. – jhanifen Oct 03 '10 at 16:27
1
You don't want ajax just do this:
window.location = "http://mywebsite.com?web=info";

Hogan
- 69,564
- 10
- 76
- 117