Bug in javascript rendered pages

User Help for Seamonkey and Mozilla Suite
Post Reply
Greg C. Miller
Guest

Bug in javascript rendered pages

Post by Greg C. Miller »

I've discovered that if you render multiple pages completely in javascript in a framed environment, when you click the back button, your scripts no longer have permission to access functions that they should have, example follows:
// file nutscrape_frames.htm
<HTML>
<HEAD><SCRIPT>
function generate_error() {
alert("Hey it works");
}
function generate_new_display() {
top.display.document.open();
top.display.document.write("After clicking the BACK button, click on <a href='javascript:top.generate_error()'>generate error</a> and the javascript link will no longer work, instead generating an uncaught exception: permission denied in the javascript console");
top.display.document.close();
}
</SCRIPT>
<TITLE>Header</TITLE>
</HEAD> <FRAMESET ROWS="100,*"> <FRAME SRC="nutscape.htm" NAME="cbar">
<FRAME SRC="about:blank" NAME="display"> <NOFRAMES>
<BODY>
<P><I>This document requires a browser that can view frames.</I></P>
</BODY> </NOFRAMES></FRAMESET>
</HTML>
// file nutscape.htm
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<P><A HREF="javascript:top.generate_new_display();">Click this twice to dynamically render a new Page</A>
then click the BACK button</P> </BODY>
</HTML>
Post Reply