Hi, I have an iframe on my page, and when buttons are clicked in my site changing the content of the frame, I want the buttons to change the URL, so it can be bookmarked and linked. However I do not want the URL change to force the entire page to reload.
I was given this code….
[QUOTE]
function loadsource()
{
var defaultPage = “home.html”;
var query = window.location.search.substring(1);
var pos = query.indexOf(‘=’);
if (pos > 0)
{
var frameSource = query.substring(pos+1);
window.frames[“canvas”].location = frameSource;
}
else
{
window.frames[“canvas”].location = defaultPage;
}
}
Which allows the site to load up particular content in the frame based on url.
Then I got this code…
[QUOTE]
function change_parent_url(url)
{
document.location=url;
}
Which changes the parent URL to whatever I put in. But with this, the entire page reloads, which defeats the point of having an iframe.
Finally, I stumbled upon this code, which I’m told will change the url without reloading, but I don’t know how it works or how to integrate it into the previous codes.
[QUOTE]
document.location.hash = “mylocation”;
If anyone can help me understand this, thanks in advance.