Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: Re-directing access within frames - Revisited

Feedback on: Re-directing access within frames - Revisited

Sent by Stephan Natschlaeger on November 04, 1999 at 09:08:16: - feedback #567

Worth:
Very worth reading

Length:
Just right

Technical:
Just right

Comments:
I implemented your suggested code and it works fine. However, I have two questions:

1) Is it possible to change the text shown as "Location" from "http://.../frameset?contents.htm&title.htm&main.htm" to something like
"http://.../frameset" ?

2) How do I modify the code when the page I want to change (main.htm) is located in a subdirectory, e.g. frameset.htm is located in the directory "http://.../main/" and I want to address a page located in "http://.../main/sub1/". It is no problem to reach the page, but what do I have to do in order that a visitor who directly loads
"http://.../main/sub1/test.htm" will get it within the frameset?





Sent by Ewout Wierda on November 06, 1999 at 06:50:00: - feedback #570

Worth:
Very worth reading

Length:
Just right

Technical:
Just right

Comments:
Although I have not yet learnt even the basics of Javascript, it appears that I might have one or two useful improvements to your 'fra-framed-med' scripting, unless the problem I encountered was due to my misunderstanding.

The first problem relates to files in folders. In larger sites, say at the fictional site "www.website.com", it may well be that a number of files which should find place in the "main" frame, are placed in folders. For example, the file "main2.htm" might be placed in the folder "mainfiles", so that the full reference to that file would be "http://www.website.com/mainfiles/main2.htm". In this situation, your scripting would render the following non-existing URL: "http://www.website.com/mainfiles/frameset.htm?contents.htm&title.htm&mainfiles/main2.html". In other words, the scripting causes the browser to expect that the files referred to are in the same "mainfiles" folder as where the "main2.htm" page is placed.

I believe the cause for this problem is in the coding " lastIndexOf('/') ". This coding is found, as you are no doubt aware, in the definition of "var newURL". If two dots are inserted before the slash, as in ' lastIndexOf('../') ', then the problem is solved, and the resulting URL is as it should be: "http://www.website.com/frameset.htm?contents.htm&title.htm&mainfiles/main2.html".

I hope this may be of help to those who work with folders.

The second problem I encountered is probably of less general use, but still it may be worth reporting it. On my web site, the URL of the "title" frame is dependent on that of the page in the "main" frame. So, "main.htm" would cause "maintitle.htm" to load, and "main2.htm" would bring up "maintitle".htm". This is done to cater for the use of three different organisational logo's in one web site.

I found that the only way to continue to enable this in combination with the 'fra-framed-med' scripting is to create an empty page called for example "emptytitle.htm" and to have the frameset in "frameset.htm" refer to that "emptytitle.htm". Then, as soon as "emptytitle.htm" is loaded, "main.htm" will cause the "title" frame to load "maintitle.htm" or, as the case may be, "main2.htm" will cause the "title" frame to load "maintitle2.htm". Without the otherwise useless initial loading of "emptytitle.htm" into the "title" frame, a main page may end up having the wrong title page displayed above it.

Perhaps there are others who have a title page for each main page as I do, and would benefit from this.






Sent by Gary Davis on February 11, 2000 at 13:37:40: - feedback #808

Worth:
Very worth reading

Comments:
Interesting article - too bad it is so difficult to handle all the different browsers.

I am attempting to solve another similar problem with frames. My site sells CDs and is sometimes incorporated within another site as a frame (see www.hotpoop.com and www.75music.com).

When it gets to the credit card SSL page, the secure lock usually does not display since the other frames (outside of my control) are not SSL. This is a common problem among many sites.

My solution is to determine if I am framed and in SSL mode and if so, pop up a window to accept the credit card. This window will have the lock. Once entered, the window is closed and returns to the normal window.

This is done with a combination of server-side code and client-side.

I prefer not to remove the frames but do so for the browsers I can't easily support (X11, MSN, AOL, WebTV for now).

Any feedback would be appreciated.

Thanks,
Gary Davis
Mgr. Internet Development
Alliance Entertainment Corp.


Sent by PcVII on February 20, 2000 at 11:56:32: - feedback #835

Worth:
Worth reading

Comments:
the first two articals i didn't know what the heck was going on but this last one i got it to work

so thank u technical ppl :)


Sent by Ivan Peters on February 23, 2000 at 06:05:43: - feedback #845

Worth:
Very worth reading

Length:
Just right

Technical:
Just right

Comments:
A couple of thoughts for you...

When testing if the page is in the correct frameset, wouldn't it be simpler to name the "content" frame ergi87143548 and then test with

if (self.name != "ergi87143548) {

it avoids the need for the hidden frame and may even avoid the need for the image.

Opera replace() tainting:

Seems to me that most Opera users are going to have lots of problems with lots of sites that do some sort of frame break-out. Rather than the new window thing, I would be inclined to generate BODY section (instead of the frameset) for this browser saying "This site cannot be loaded inside someone elses frameset. Unfortunately, your browser does not allow us to load the site over the frameset. Click here [link with TARGET="_top"] to replace the frameset or click here [link to instructions for changing Opera settings] to find out more about why your browser does this.

Anyway, that's my two-penny-worth.

Cheers

Ivan



Sent by Franky Backeljauw on October 20, 2000 at 05:06:15: - feedback #1888

Worth:
Very worth reading

Comments:
Maybe I did not read it that well, but I missed the explanation about what the 'framed.htm' is for in the dispFramed function at the end (fixed code).

Should it be just some name, or should it be the name of the file in which this code is ?


Sent by Richard Earney on November 01, 2000 at 07:20:46: - feedback #1939

Worth:
Very worth reading

Comments:
The main problem I see with this is that if you use the back button you tend to end up back on the same page.

Is there a war around this?


Sent by Bonnie van den Born on November 02, 2000 at 08:49:05: - feedback #1945

Worth:
Very worth reading

Comments:
I aplied it to http://www.motornet.nl/bikes/bike.html

But on a mac, with ie 5.0 they can still link your pages into an alien frame, with netscape it works okay.

Bonnie


Sent by akelectro on January 20, 2001 at 00:31:08: - feedback #2259

Worth:
Worth reading

Comments:
Well, after reading the article, I clicked the link to load the entire frameset. I happen to be using Opera 4.0. It said that the browser did not support frames or frames have been disabled. Neither is true. So Opera 4.0 STILL has some issue. I came to this article to see if I could find a solution to another problem with Opera and the "AOL browser". When a window is closed, there seems to be no way to open another automatically. Since both these browsers are using an MDI interface, I blame this. However, AOL (5.0 version tested) opens the windows default browser with the new url. JavaScript can open a new window just fine but not when the window containing the script is closed. If only there was a way to open a window without the "X" in the corner. Then the window could only be closed using JavaScript, which works ok.


Sent by Jim Barton on September 13, 2001 at 09:19:57: - feedback #3154

Worth:
Very worth reading

Length:
Just right

Technical:
Just right

Comments:
You guys just saved my life. I've been given the task of re-vamping a very large site, and the use of frames to ease navigation seemed to be the best option.

All other materials I've seen on this subject utilize very basic and unusable code (which turned out to be incompatible and annoying when one tries to hit the "back" button). This article was a breath of fresh air in how detailed the solution presented was.

You should have heard me jumping around my office when I got the code to work on my prototype pages. What a load off my mind!

NOTE TO THOSE READING THE ARTICLE FOR THE FIRST TIME: Regardless of your level of experience, don't be intimidated by the code. Just copy/paste the two sets of code at the bottom of the article and insert them into your page. If you look at it long enough, you'll see exactly where you need to make minor modifications to fit your site. Refer back to the article if there's a point you're stuck on, and re-read the whole thing to trace the genious of these people...but the code itself is very well written and worked right away for me.

Thank you guys!


Sent by ramesh on December 08, 2001 at 15:13:49: - feedback #3405

Worth:
Worth reading

Comments:
ok. it is good.
but i want some details on creating the frameset.
is there any rule for creating the frameset.
and whether can i have more than one framaset in a php page.
if it yes then how to access thos frames.
can u plz.. tell about these issues..thanks


Sent by H woodrow on June 01, 2002 at 09:55:43: - feedback #3918

Worth:
Very worth reading

Comments:
Works fine in IE but must Bookmark from the browser bar to redirect to the correct page in the frameset. crashes if add to favorites by right clicking on frame page
Cannot get to work in Netscape 6
Any help would be appreciated
Thanks in advance Site where code is www.dcps.co.uk


Sent by sam gong on December 11, 2002 at 20:35:46: - feedback #4312

Technical:
Too technical

Comments:
I've read your articles on redirecting frames (1, 2, and revisited.) Thanks for all the input. Now here comes my humble question: I've tried to apply the revised info for my simple 3 frame page, but I'm having a hard time trying to figure it out! The problem comes with trying to figure out the index numbers for the frames. I know that starting from the top, the index should be 0. And for me, the 0 frame is my "ergi" frame.
But the frameset javascript in the beginning conditional statement STILL eludes me (here, I feel stupid in trying to understand.) Specifically with the "var passed" section and how I can apply that within my three frame structure.

My frameset structure looks like this:
<html>
<head>
<title>Untitled Document</title>
</head>

<frameset rows="100,*" cols="*" frameborder="yes" border="0" framespacing="0">
<frame name="ergi2000" scrolling="NO" noresize src="topframe/top.html">
<frameset cols="130,*" frameborder="yes" border="0" framespacing="0">
<frame name="leftFrame" scrolling="NO" src="leftframe/homemenu.html" noresize>
<frame name="mainFrame" scrolling="yes" src="mainframe/home/homemain.html">
</frameset>
</frameset>
<noframes><body bgcolor="#FFFFFF">

</body></noframes>
</html>

And I'm still stuck on figuring out which frames to apply the "passed =" statement to. Between article 1 and 2, I couldn't figure out how to modify this line. Please help?

Best Regards,
Confused student



©2018 Martin Webb