# Changing part of url through document.location

**URL:** <https://forum.kirupa.com/t/changing-part-of-url-through-document-location/275126>\
**Category:** Uncategorized\
**Created:** [November 10, 2008, 10:34am UTC](https://forum.kirupa.com/t/changing-part-of-url-through-document-location/275126 "2008-11-10T10:34:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jareish](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@Jareish](https://forum.kirupa.com/u/Jareish)\
**Post date:** [November 10, 2008, 10:34am UTC](https://forum.kirupa.com/t/changing-part-of-url-through-document-location/275126/1 "2008-11-10T10:34:09Z")

</div>

Hi, I need to change the url in the user his browser, when he presses a button based on the buttonname. But it only needs to be visual (in other words, not going to the url, but only see it change). So people can bookmark it.

Now I have this:

```php
 
ExternalInterface.call("document.location +=" , "?loc=" + location);

```

I need to stay in the current Flashapp, but change the url (just visually). Is this possible? If not, how can I strip the url dynamicly from the “?loc=something” part. And with dynamicly I mean, it detects what domain I am instead of hardcoding it.

Thanks
