Remote Scripting - Adjusting Your History

- Introduction
- Targeting a Hidden iframe
- Moving Data From an iframe to the Parent
- Moving Object Level Data Across Frames
- Adjusting Your History
- Access Denied - Domains, Remote Scripting, and Security

for IE 5+ and Netscape 6+

There's one little drawback to remote scripting - loading a page in an iframe changes your history. The user performs some action that causes a page to load in a hidden iframe, they click the back button, and....nothing. In order to go back to the previously viewed page they would have to click back twice. Give it a try using the form below. Choose a State and then click the back button.

 

Find Your State Representative - 107th Congress
<div id="results1">

</div>

 

 

Fortunately, there's an easy way to correct this problem. In the very last line of the script in the iframe put history.go(-1);

The State table will load and then the page in the iframe will return to the previous blank page.

Before you try the next example, make sure you click the back button once for each time you chose a State in the last example.

<script>
 // - this is the script in the iframe results page
 parent.showReps(document);
 history.go(-1);
</script> 
Find Your State Representative - 107th Congress
<div id="results2">

</div>

 

Access Denied - Domains, Remote Scripting, and Security >>








PXL8 2003