Load An iFrame without having a history

Posted on 2004-04-15
Last Modified: 2012-05-04
Hi guys, I wonder if i can disable the page history in iFrames..

I have a Main.asp
in this page, there is a iFrame that calls another URL

When the iFrame loads another page (e.g. DeleteWorkSpace.asp),
it would save DeleteWorkSpace.asp into the history which i dun want it to happen.

Is there a solution?

Below is my IFrame :

<iframe name='contentFRM3' id='contentFRM3' width='0%' height='0%' frameborder='0' scrolling='no' frameSpacing='0'></iframe>
<div id='contentLayer3' style='position:absolute; width:345px; height:115px; z-index:1; left: 186px; top: 304px'></div>

And I use javascript to load an page into that iframe :

document.getElementById('contentFRM3').src = "deleteWS.asp"


How am i gonna write to disable the page history from being load?

I've used
      response.Expires = -1
      response.Expiresabsolute = Now() - 2
      response.AddHeader "pragma","no-cache"
      response.AddHeader "cache-control","private"
      response.CacheControl = "no-cache"
but its useless, its still stores the history.....

Hope u guys can help me, thanX.

Question by:FantasyEx
LVL 63

Expert Comment

ID: 10831589
Did you try:

document.getElementById('contentFRM3').location = "deleteWS.asp"


Expert Comment

ID: 10832066

Expert Comment

ID: 10832106
better :

<body onunload="document.getElementById('contentFRM3').location.replace('about:blank');">

location.replace(newURL)  does not add newURL to history just overwrite the previous, if you overwrite the current url for the iframe with another  it disappear from the navigation history
LVL 25

Accepted Solution

devic earned 250 total points
ID: 10836580

   Response.AddHeader "Pragma","no-cache"

for me this works fine.

Expert Comment

ID: 10838428
I agree with devic. Plus it is all ASP which I think is better in this case...IMHO


Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to refer to value 8 50
How do specify keydowns in JavaScript 3 47
Getting selected value of a dropdown with jquery 7 40
Javascript Form Change 5 23
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (, typical array handling might look like this: (CODE) B…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question