473,414 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

breaking out of frameset problem

Hi,

I use the following code to force the page to load into the intended
frameset (navigation purposes) if visitors come to pages in a certain
section of the site from search engines/external links.

<script language="JavaScript"><!--
if (parent.location.href == self.location.href)
window.location.href = 'index.htm?pageone';
//--></script>

This works very well BUT.... if the visitor hits the browser back button all
it does is reload the page and frameset unless you either use the onsite
navigation or call up the previous pages with the carat by the back button.

Is there any way of making sure that if the visitor simply hits the back
button they break out of the frameset and return to wherever they cam from?

Thanks
Jul 20 '05 #1
1 3776
"David" <da*************@ntlworld.com> writes:
Hi,

I use the following code to force the page to load into the intended
frameset (navigation purposes) if visitors come to pages in a certain
section of the site from search engines/external links.

<script language="JavaScript"><!--
if (parent.location.href == self.location.href)
window.location.href = 'index.htm?pageone';
//--></script>

This works very well BUT.... if the visitor hits the browser back button all
it does is reload the page and frameset unless you either use the onsite
navigation or call up the previous pages with the carat by the back button.

Is there any way of making sure that if the visitor simply hits the back
button they break out of the frameset and return to wherever they cam from?

Try
if (top == self) {
location.replace('index.htm?pageone');
}

Using location.replace means that the current page is replaced, even
in the history, with the new one.

Consider whether it is a good idea to force how people see your page,
and that your frameset depends on javascript. Perhaps you should have
a different frameset for this that depends on javascript, and a
non-javascript one for people who enter at the front page.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable...
5
by: dan (dj74) | last post by:
Hi All, my application looks like this: (file index.php) application = new MyApplication(); application->run(); //all code of the application is in MyApplication class and other
6
by: Wladimir Borsov | last post by:
I would like to load multiple web pages from Internet into ONE single browser window - one below the other. How do I do that most easily ? One idea is to built a frameset (for e.g 6 web pages)...
6
by: Stefan Mueller | last post by:
After my web page has been loaded I'm doing some tests with a JavaScript. If I figure out that something is wrong I'd like to reload the whole frameset. With Internet Explorer and Mozilla Firefox...
2
by: Mark | last post by:
Hello. I am working on a common problem. . .restoring frameset context when a user links directly to a page. Loading the frameset isn't a problem. . .there are numerous examples of simple...
3
by: mark4asp | last post by:
According to this <http://css-discuss.incutio.com/?page=BoxModelHack> IE6 will display differently to the W3C standard. Only IE6/strict and I suppose IE 7 display correctly. IE 6 transitional and...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
4
by: maminx | last post by:
Hello..i have problem, hope someone can help me..i have this frameset below : <FRAMESET ROWS="55%" COLS="37%,63%"> <FRAME NAME="runningTrade" SRC="http://runningtrade.com" scrolling="no"> ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.