Solved

Load An iFrame without having a history

Posted on 2004-04-15
8
2,276 Views
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.


0
Comment
Question by:FantasyEx
8 Comments
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Did you try:

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

0
 
LVL 5

Expert Comment

by:alambres
Comment Utility
document.getElementById('contentFRM3').location.replace("deleteWS.asp");
0
 
LVL 5

Expert Comment

by:alambres
Comment Utility
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
0
 
LVL 25

Accepted Solution

by:
devic earned 250 total points
Comment Utility
<%

   Response.CacheControl="no-cache"
   Response.AddHeader "Pragma","no-cache"
   Response.Expires=0

%>
for me this works fine.
0
 
LVL 3

Expert Comment

by:robotman757
Comment Utility
I agree with devic. Plus it is all ASP which I think is better in this case...IMHO

Dan
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now