# Address Bar after XMLHTTP request

**URL:** <https://www.ruby-forum.com/t/address-bar-after-xmlhttp-request/137236>\
**Category:** Rails\
**Created:** [May 10, 2008, 3:15pm UTC](https://www.ruby-forum.com/t/address-bar-after-xmlhttp-request/137236 "2008-05-10T15:15:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkeyten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f08c70/32.png) [@monkeyten](https://www.ruby-forum.com/u/monkeyten)\
**Post date:** [May 10, 2008, 3:15pm UTC](https://www.ruby-forum.com/t/address-bar-after-xmlhttp-request/137236/1 "2008-05-10T15:15:18Z")

</div>

Hello all,

I was trawling the web for an answer to this one - is there an  
accepted/preferred methodology for updating the browser address bar  
after an AJAX page transition?

For example, I have a list of folders, which when clicked use an  
XMLHTTP request to display the contents via an update to a

.  
After this is done, I would like to show a RESTful url in the address  
bar for people to be able to share access the same view via a normal  
HTTP GET.

Any thoughts/ideas would be much appreciated!

Monkeyten

---

<div class="post-metadata">

**Author:** ![monkeyten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f08c70/32.png) [@monkeyten](https://www.ruby-forum.com/u/monkeyten)\
**Post date:** [May 12, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/address-bar-after-xmlhttp-request/137236/2 "2008-05-12T17:36:28Z")

</div>

For security reasons (phishing), you can’t change the location bar from  
javascript without loading the new location. You’ll have to display that  
permalink in a prominent place in the page. For example, breadcrumbs at  
top-left that spell out the URL.

---

<div class="post-metadata">

**Author:** ![monkeyten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f08c70/32.png) [@monkeyten](https://www.ruby-forum.com/u/monkeyten)\
**Post date:** [May 12, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/address-bar-after-xmlhttp-request/137236/3 "2008-05-12T19:44:08Z")

</div>

You can change the location bar from javascript without reloading as  
long as you only change anchors. It would however require some  
javascript on page load to take the users to that folder.

Tiago M.
