Solved

iframe refresh problem

Posted on 2003-11-14
4
812 Views
Last Modified: 2008-03-10
Hi there,

I have a site starting with the page "index.aspx" which contains an iframe and its source is default.aspx (in fact the original start up page is default.aspx, I used iframe just to hide the URL)

while I am browsing other pages linked to default.aspx and click the refresh button, browser goes back to dafeult.aspx.

How can I stay on the current page?

Thanks...
0
Comment
Question by:burakbaysal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 250 total points
ID: 9747241
You can't. When you load the page, the content of the iframe is determined by the src attribute. You would have to change the src attribute to change the page loaded when you refresh.

Obscuring the URI is pretty pointless anyway. Anyone who wants to find it can do so with little difficulty, so you just create an annoying barrier for the visitor.
0
 
LVL 31

Assisted Solution

by:seanpowell
seanpowell earned 250 total points
ID: 9747362
The browser refresh button will always reload the parent frame, not the current src of the iframe. One option you can use would be to include a refresh button in the actual iframe page, displayed prominently so people are likely to use it instead of the browser one. But it's not foolproff obviously.


Each iframe page would have the following, with the form action set the the name of the page:

<html>
<head>
<script language="JavaScript1.2">
<!--
function refresh()
{
    window.location.reload( false );
}
//-->
</script>
</head>
<body>
<form method="GET" action="contacts.htm">
<input type="button" onclick="refresh()" value="Refresh Page" name="mybutton">
</form>
<h1>Contact Us Page</h1>
</body>
</html>
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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…

726 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