473,499 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forcing page into frame

Hi,

I've been asked to add some pages to an existing web-site that was
done in frames (two different sets of frames with different navigation
links).

I need to ensure that if someone tries to load a page without the
frameset it will force the frameset to take effect with the correct
page displayed.

I've got this code at the top of one of the child pages:

<script language="Javascript">

if (top.location == self.location) {
top.location = '../../index.htm.htm'
}
</script>

This almost works, it opens the frameset correctly, but it always
shows the original file that the frameset contains.
How can I force it to open with the correct page displayed?

Regards,
Bernard D.
Jul 23 '05 #1
10 1745
1. you have to transmit the url of the page to be displayed to the
frameset (using the querystring for example) like
'frameset.htm?uri=somepage.htm'

2. have the frameset figure out if a uri is transmitted, and if yes,
open it the window you like.

micha

Jul 23 '05 #2
On 4 May 2005 03:23:40 -0700, "micha" <ch*********@web.de> wrote:
1. you have to transmit the url of the page to be displayed to the
frameset (using the querystring for example) like
'frameset.htm?uri=somepage.htm'

2. have the frameset figure out if a uri is transmitted, and if yes,
open it the window you like.

micha


Thanks Micha,

that gives me a starting point.
However, how would I then convert the ULR into a text string within
the frameset?

I know how to do it in PHP easily enough, but this javascript stuff is
a bit obscure to me.

Regards,
Bernard D
Jul 23 '05 #3
suppose this is what the url looks like:

HOST/PATHES/frameset.htm?uri=somepage.htm

window.location.search will deliver ?uri=somepage.htm

window.location.search.slice(5) delivers somepage.htm

Jul 23 '05 #4
i just read you are familiar with php.

if you have it available on yor server, there would be a much neater
solution.

1. transmit the query string to the frameset as above.

2. have a php script create the frameset on the fly and code the url
directly into the html output.

advantage in my opinion: reduces the amount of javascript

micha

Jul 23 '05 #5

"micha" <ch*********@web.de> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
suppose this is what the url looks like:

HOST/PATHES/frameset.htm?uri=somepage.htm

window.location.search will deliver ?uri=somepage.htm

window.location.search.slice(5) delivers somepage.htm


That's helpful to me too, but my URL is like:

HOST/PATHES/frameset.htm?uri=somepage.htm&a=a&b=b&c=c

How do I split them up?

Tom


Jul 23 '05 #6
In article <7l********************************@4ax.com>, Bernard Davis
<bdavis(deletethis)@castlecs.co.uk> enlightened us with...
that gives me a starting point.
However, how would I then convert the ULR into a text string within
the frameset?

I know how to do it in PHP easily enough, but this javascript stuff is
a bit obscure to me.


http://www.ipwebdesign.net/kaelisSpa...cFrameset.html

HTH

--
--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7
On 4 May 2005 05:24:33 -0700, "micha" <ch*********@web.de> wrote:
i just read you are familiar with php.

if you have it available on yor server, there would be a much neater
solution.

1. transmit the query string to the frameset as above.

2. have a php script create the frameset on the fly and code the url
directly into the html output.

advantage in my opinion: reduces the amount of javascript

micha


Thanks for your help. I've done a quick mock-up in PHP to see how
easy it is, took two minutes and worked fine, the only problem is of
course that the parent page now has to be xyz.php rather than xyz.htm.

I'm not too sure if the client will be happy with this as there are
hundreds of other pages all refering back to xyz.htm.

Pity I didn't do the whole site from the beginning.

Regards,
Bernard D
Jul 23 '05 #8
On Wed, 4 May 2005 07:26:39 -0500, kaeli <ti******@NOSPAM.comcast.net>
wrote:
In article <7l********************************@4ax.com>, Bernard Davis
<bdavis(deletethis)@castlecs.co.uk> enlightened us with...
that gives me a starting point.
However, how would I then convert the ULR into a text string within
the frameset?

I know how to do it in PHP easily enough, but this javascript stuff is
a bit obscure to me.


http://www.ipwebdesign.net/kaelisSpa...cFrameset.html

HTH


Thanks for that. I'll bear it in mind as a 'Plan B'

Regards,
Bernard D
Jul 23 '05 #9

Bernard Davis deletethis wrote:
On 4 May 2005 05:24:33 -0700, "micha" <ch*********@web.de> wrote:
i just read you are familiar with php.

if you have it available on yor server, there would be a much neater
solution.

1. transmit the query string to the frameset as above.

2. have a php script create the frameset on the fly and code the url
directly into the html output.

advantage in my opinion: reduces the amount of javascript

micha
Thanks for your help. I've done a quick mock-up in PHP to see how
easy it is, took two minutes and worked fine, the only problem is of
course that the parent page now has to be xyz.php rather than

xyz.htm.
I'm not too sure if the client will be happy with this as there are
hundreds of other pages all refering back to xyz.htm.

Pity I didn't do the whole site from the beginning.

Regards,
Bernard D

there's tools to search/replace text over many files. i use an editor
called proton for that (www.meybohm.de), but i don't know if there's an
english version.

or use the rewrite engine of the apache server to map any access for
frameset.htm to frameset.php

micha

Jul 23 '05 #10
Tom Scales wrote:
"micha" <ch*********@web.de> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
suppose this is what the url looks like:

HOST/PATHES/frameset.htm?uri=somepage.htm

window.location.search will deliver ?uri=somepage.htm

window.location.search.slice(5) delivers somepage.htm

That's helpful to me too, but my URL is like:

HOST/PATHES/frameset.htm?uri=somepage.htm&a=a&b=b&c=c

How do I split them up?


location.search.split("&")[0].split("=")[0];
for one...
Mick
Jul 23 '05 #11

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

Similar topics

1
2394
by: duane | last post by:
Dear Experts: I have a problem. When you enter the website I am working on, wherever you go within the website, the URL address on the website will display: "http:\\..\index.html", whether...
2
3404
by: petev | last post by:
Hello, can anyone help me out?? Maybe its a bit complicated, maybe not :) I'll try to explain. Am not a programmer so have patience! I have a website whose url looks like this:...
1
1428
by: Bongolation | last post by:
I've looked in the FAQ and didn't see anything on this. There must be a simple solution to this VERY common problem: A site featuring many text articles and archives has a frameset of two...
1
1539
by: Harshal | last post by:
Hello, I have a html page with 3 frames. If i specify the source for any of frames as http://www.gmail.com or http://www.hotmail.com, all frames go away and the site utilizes the full window. I...
5
2407
by: Dan | last post by:
We have a simple site. It's a frameset with two frames a left and a right. The left frame is essentially a list of records from a database (using a server-side repeater control). When you click...
4
4829
by: WAZOO | last post by:
Sorry if this is obvious to everyone (except me). I've done a Google search and I'm not seeing anything encouraging that addresses my issue. My very large multispecialty medical practice needs...
0
1379
by: Dan Kimhi | last post by:
I am using the following code to open a CrystalReport object (cr) as a pdf page : Dim s As System.IO.MemoryStream = cr.ExportToStream(CrystalDecisions..ExportFormatType.PortableDocFormat) With...
1
1198
by: invinfo | last post by:
I know you can use JS to prevent other sites from using your .html in a frame / frameset. Can the opposite be done ? If your page is designed to be viewed inside a Frame / FS only; and your...
42
3809
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
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
4600
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...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.