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

Feedback on: Re-directing access within frames - Revisited, November 06, 1999 at 06:50:00:

You are here: irt.org | About | Feedback | 570 [ previous next ]

Feedback on:
Re-directing access within frames - Revisited

Sent by
Ewout Wierda on November 06, 1999 at 06:50:00:

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.






Other feedback on 'Re-directing access within frames - Revisited' - show all

©2018 Martin Webb