C
chanelzy
I have my main site content loaded into an iframe while a small flash
app is placed in the main page:
<html><body>
<iframe id="content" src="content.html" onload="updateTop();"></
iframe>
<div id="flash"><!-- embed code --></div>
</body></html>
Everything about this structure works fine except the url on the
address bar stays the same. When i try to change the hash of the
"top" window whenever a link is clicked, this causes two history
indexes to be created:
document.body.onclick = function(event) {
event = event || window.event;
var target = event.target || event.srcElement;
if (target.nodeType == 3) { target = target.parentNode; }
if(target.href && target.href!="#") {
top.location.hash = target.href; // change hash of parent
}
// allow page to be loaded
}
I then used the location.replace hack to change the top window hash
and prevent an extra history index from being created:
document.body.onclick = function(event) {
event = event || window.event;
var target = event.target || event.srcElement;
if (target.nodeType == 3) { target = target.parentNode; }
if(target.href && target.href!="#") {
top.location.hash = target.href; // change hash of parent
top.location.replace(target.href);
}
return false; // prevent extra history index
}
This allowed the top window to be bookmarkable and utilize the history
back/forward functions, but it doesn't actually contain the iframe's
history index so the actual contents of the page does not change.
I want the flash to stay put so users can utilize it uninterrupted
from page reloads. If anyone knows how to make an iframe as the main
content container while also making the parent window barkmarkable, I
would really love to know how.
app is placed in the main page:
<html><body>
<iframe id="content" src="content.html" onload="updateTop();"></
iframe>
<div id="flash"><!-- embed code --></div>
</body></html>
Everything about this structure works fine except the url on the
address bar stays the same. When i try to change the hash of the
"top" window whenever a link is clicked, this causes two history
indexes to be created:
document.body.onclick = function(event) {
event = event || window.event;
var target = event.target || event.srcElement;
if (target.nodeType == 3) { target = target.parentNode; }
if(target.href && target.href!="#") {
top.location.hash = target.href; // change hash of parent
}
// allow page to be loaded
}
I then used the location.replace hack to change the top window hash
and prevent an extra history index from being created:
document.body.onclick = function(event) {
event = event || window.event;
var target = event.target || event.srcElement;
if (target.nodeType == 3) { target = target.parentNode; }
if(target.href && target.href!="#") {
top.location.hash = target.href; // change hash of parent
top.location.replace(target.href);
}
return false; // prevent extra history index
}
This allowed the top window to be bookmarkable and utilize the history
back/forward functions, but it doesn't actually contain the iframe's
history index so the actual contents of the page does not change.
I want the flash to stay put so users can utilize it uninterrupted
from page reloads. If anyone knows how to make an iframe as the main
content container while also making the parent window barkmarkable, I
would really love to know how.