Reload Iframe without adding an entry to History IE

I have been working on getting a cross site collection list view in SharePoint and have implemented it with a page viewer web part. On load a variable is pulled from the page and changes the src of the iframe to show related documents. There is only one problem. IE! When the src changes IE keeps a history so when you press back it reloads the iframe with the original content.

This is not how I want it to work. So I need to change the src of the iframe without adding to the IE history. After looking around I found this, which says you need to create it dynamically. However I can’t do this because for some reason SharePoint doesn’t like me adding new iframes to the page. I also tried putting an iframe within a HTML form webpart but that didn’t display.

After a while I found this, which says you can use window.frames['frame_name'].location.replace(“….”);

Finally! Just add your frame name and the new location and the first one won’t be kept in history.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>