View Full Version : [DHTML] Correct URL in frameset based site
11-03-2007, 09:30 PM
1) CODE TITLE: Correct URL in frameset based site
2) AUTHOR NAME/NOTES: Arie Molendijk
3) DESCRIPTION: In frameset based sites, the URL in the address bar doesn't (normally) change on page transition. This might confuse the visitor and makes bookmarking of specific pages impossible. So it seems useful to have the name of the main frame's page (that the visitor is actually viewing) in one or more pages of the frameset based site. A click on the 'name' will then make it possible to bookmark the (specific) page.
4) URL TO CODE: http://molendijk.110mb.com/CorrectUrl/
or, ATTACHED BELOW (see #3 in guidelines below):
11-03-2007, 11:52 PM
Hm... doesn't work for me. (FF2, win)
Nor Fx3. Does in Konqueror.
It's an interesting script, and (used with an absolute URL) can help to lessen one of the main accessibility problems with frames. Still doesn't rectify it completely, though: I'd recommend against using frames even with this script.
11-04-2007, 01:42 AM
Actually, I think it does work in FF2; just not the way we expect it to. I checked it out in IE6+ and it works the same as in FF2. There is a little gray box at the top right corner of every frameset that holds the url of the page that is in the "main" frame. I personally think this is useless, but others may think differently.
11-04-2007, 01:59 AM
Haha. That is worthless. But I assume that's debugging, as Twey said it works in Konq.
11-04-2007, 01:16 AM
Hello Daniel, Twey, Testingsite,
It works for me in FF 184.108.40.206, Moz. 1.7.5, Netscape 7.0, IE and Opera 9.23 (all win).
You should see a change in the gray box at the top right corner of every frame (of the frameset) at page transition (although almost imperceptible): page1.html when you visit page 1, page2.html when you visit page 2, etc.
I agree that it seems useless as it is. But combined with this thread (http://www.dynamicdrive.com/forums/showthread.php?t=25009), it might be of some help for people who want to use framesets without too many of the disadvantages.
11-04-2007, 02:24 AM
Glad. Thanks for the information!
11-04-2007, 01:03 PM
Since there was a little debate on the usability of the script, I made some changes and clarifications. The idea behind it allows us to do things that would be hard to accomplish otherwise. It can be used, among other things, to bookmark specific pages of a frameset.
11-04-2007, 04:25 PM
...It's an interesting script, and (used with an absolute URL) can help to lessen one of the main accessibility problems with frames. Still doesn't rectify it completely, though: I'd recommend against using frames even with this script.
I made some corrections. Are frames more acceptable to you now? (In this regard, also observe the link (to: particular use of framesets) in the left frame.
11-04-2007, 04:28 PM
Well, better. But now just link to that url, rather than still not updating the url.
We've always been able to get around frames, but having to manually find a url and bookmark that, etc., is just a pain.
Since you've setup direct urls that work, use 'em.
Plus, it seems like you can make it shorter than what actually shows up there; I'd suggest working on that, too.
11-04-2007, 04:43 PM
Thanks for the comment.
But what do you mean by 'But now just link to that url, rather than still not updating the url. ... We've always been able to get around frames, but having to manually find a url and bookmark that, etc., is just a pain.?'
You mean 'put the url in the address bar?'. And what is 'manually'? I don't do that in the script.
Apologies for my rather slow 'understanding capacities'.
11-04-2007, 04:50 PM
Well, the links still use a target attribute.
Instead of doing that, you should use the DIRECT link.
Then it will change the url in the address bar and *should* still work to load in the frames.
But, then again, it will also reload everything, sorta defeating the point.
If I get a bit of time, I may try something like that.
It will both allow for the direct url to work and no reload.
The whole point of this script should be to find a way to update the URL in the address bar. That's the big advantage.
How would this work, including a nonJS fallback:
<a href="http://www.let.rug.nl/~molendyk/CorrectUrl/page3.html" onClick="main.location=this.href; return '#page3.html';">
<a href="http://www.let.rug.nl/~molendyk/CorrectUrl/page3.html" onClick="main.location=this.href; top.location='#page3.html'; return false;">
I'm not quite sure that will work, but the idea should be clear.
11-04-2007, 05:19 PM
Without the <base target="main">, your links load page 3 in the left frame.
I tried before to do things implying a change of the URL in the address bar, but that invariably caused a reload of 'everything'.
Thanks anyhow for your comment; I'll experiment with it.
11-04-2007, 05:39 PM
Well, more correctly, it should be
I'm thinking that the # method will work because that doesn't always cause a reload. Play with it.
11-04-2007, 05:59 PM
I'll let you know as soon as I got something.
Thanks a lot in the meantime.
Ik heet Arie Molendijk
My name is Arie Molendijk
Ich heisse Arie Molendijk
Je m'appelle Arie Molendijk
Mihi nomen Arie Molendijk
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.