Multiple iFrame History : Provided sample code

I’m really hoping someone can answer my question. Is there a way you can control history on a specific iframe?

Let say you have these file

index.html

<html>
<body>
<iframe name=“iframeA” src=“a.html” width=“100” height=“100”></iframe>
<iframe name=“iframeB” src=“b.html” width=“100” height=“100”></iframe>

&lt;input type="button" value="A history" onClick="window.frames['iframeA'].history.go(-1)" /&gt;
&lt;input type="button" value="B history" onClick="window.frames['iframeB'].history.go(-1)" /&gt;

</body>
</html>


a.html

<html>
<body>
A <a href=“b.html”>B</a>
</body>
</html>


b.html

<html>
<body>
B <a href=“a.html”>A</a>
</body>
</html>


As you can see it’s just very simple page w/ 2 frames. I created 2 button that is specific to iFrame’s history but… it does not work… Yes, it does perform “back” but at the the “top” level and not at specific iframe… I tried this on both firefox and chrome…same behavior… can someone explain what’s going on?

There is only one History object. It is theoretically possible to use the iframe onload event to maintain a cookie-based history for an iframe, but it would have to be navigated using custom controls provided on the parent page, and only same-domain URLs could be recorded.

I was really afraid of this response… I really don’t get the history API then… if there’s only 1 history then how could I access it like

window.frames[‘iframeA’].history.go(-1)

instead of

window.history.go(-1)

This is truly confusing… yeah, for now I have a similar method that’s a workaround which “sort” of works. To me…I’m a bit surprise that it would be a common sense to attach iframe history onto iframe object… eh…enough of my rants… this is bit disappointing.