DonJuma
DonJuma

Reputation: 2094

Help with changing iframe ajax

Hello there ok i may be wrong about this and if i am then i am sorry. But is it possible to change the screen with ajax by looking at whats after the "#" in the link. because when im on facebook i know that it is all an iframe yet when the screen changes so does the text after the "#". Is that what is causing the change or is that a result of the change. Because i have JavaScript on my site and when you click a function it adds a "#" to the link but never any text.

Thank you so much.

Upvotes: 0

Views: 135

Answers (1)

BudgieInWA
BudgieInWA

Reputation: 2255

The part of the URL after the # is called the "hash tag" and you can use JavaScript to change it like this:

document.location = "#abc"

You can also set the hash tag using an anchor like this:

<a href="#abc">Click me to put #abc on the end of the url</a>

To get the hash tag you can use this:

hash_tag = window.location.hash

Facebook is not displayed inside an iFrame but all of the content is generated using JavaScript, and they set the hash tag deliberately so when you reload the page, they can look at the hash tag and give you the right content.

Upvotes: 1

Related Questions