Forum Moderators: open
Also, if I understand you correctly, a generic solution may be very tricky - you may have to resort to page-specific javascript to make it work correctly across different browsers.
Kaled.
I think kaled has it right. Various browsers implement their history function differently around iframes.
In order to get consistent results of the kind you want, it will take scripting -- either client-side or more dependably, server-side (see our Javascript, PHP or Perl forums for more help in this direction.)
If you care about preserving more than the most recent state of that page, things may get very complex.
[pre]
<HTML>
<HEAD><TITLE> My Page </TITLE>
<SCRIPT language="JavaScript">
<!-- Begin
function loadpgs (page1,page4,page5) {
(I1.location.href=page1);
(MAG.href=page4);
(SAVE.href=page5);
}
-->
</SCRIPT>
<table width="214">
<td width="212"><iframe name="I1" src="HTML/1_min.html" width="200" height="200"
border="0" frameborder="0" scrolling="no"></iframe>
</td>
<td><a name="MAG" width="20" height="20"
href="HTML/1_mag.html">
<img src="ICON/magglasswht.gif" width="40"
height="40"></a>
<br>
<a name="SAVE" href="IMG/JNK.1090883375_0_1d.mol2">
<img src="ICON/save2.gif" width="40" height="40"></a></td>
<td><a href="javascript:loadpgs('HTML/1_min.html','HTML/1_mag.html',
'IMG/JNK.1090883375_0_1d.mol2')">Solution 1</a></td>
<td><a href="javascript:loadpgs('HTML/2_min.html','HTML/2_mag.html',
'IMG/JNK.1090883375_0_2d.mol2')">Solution 2</a></td>
</tr>
</table>
[/pre]
The second page is:
[pre]
<html>
<head>
<Title>1 Magnified</TITLE>
</head>
<body>
<EMBED type="chemical/x-mdl-molfile" color3D="cpk"
width="600" height="600" style="position:absolute;
top:0; left:0;" src="../IMG/flexx_XXX.1090883375_0_1d.mol2.mol"
script="select (atomno<=71); wireframe 40; spacefill
120; color cpk">
<LABEL style="position: absolute; left: 620; top: 50;
width:130; height:30;">Complex 1</LABEL>
<form>
<input type="button" value="Back to Results"
style="position:absolute; top:100; left:620; width:
130;" onClick="history.back()">
</form>
</body>
</html>
[/pre]
On the second page the EMBED tag is for the MDL Chime Pro plugin which allows me to display a chemical file. This webpage will only be viewed in IE6 cause the plugin only functions in IE6. The problem lies in the fact that when I click on the "Solution 2" link on the original webpage, and then click the "Back to Results" button on the second page, the two links, "MAG" and "SAVE" get reset to the first solution, instead of being set to the second solution, like they were when I left the original page. I hope that clears things up. Thanks!
You need to store the state of the first page so that it can be restored later. The page itself should read the stored data and restore the state when it has loaded.
So you're left with chosing a method of storing some data temporarily.
The obvious choices are :-
1) Cookie
2) A zero-width sister frame. (I think you can access script vars in other frames - never tried it).
So far as I am aware, browsers don't provide any other means of storing data temporarily.
Hope this helps,
Kaled.
Kaled.