Computing.Net > Forums > Programming > website-Refresh goes to home page

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

website-Refresh goes to home page

Reply to Message Icon

Original Message
Name: mesich
Date: October 14, 2003 at 10:24:17 Pacific
Subject: website-Refresh goes to home page
OS: Win98
CPU/Ram: P4-2.53/512Mb-DDR2700
Comment:

Hello everyone,

I have created a website for my brother. On any page when the Refresh button is selected in Internet Explorer it does not Refresh the page, it goes to the home page on the site.

It was working fine, I'm not sure what I could have done to create this.

I was told it's because I created the page using frames, however it worked just fine for several days.

I also have another site using the same layout with frames and there is no problem with it.

Here is a link to the site.

Thank you very much in advance for your help.

Best Regards,
Mesich



Report Offensive Message For Removal


Response Number 1
Name: Infinite Recursion
Date: October 14, 2003 at 10:51:47 Pacific
Reply: (edit)

Your url doesn't work.
http://www.duncan007.com/


Report Offensive Follow Up For Removal

Response Number 2
Name: mesich
Date: October 14, 2003 at 11:02:14 Pacific
Reply: (edit)

Hi Infinite Recursion, hello everyone,

The server was apparently down for a few minutes, it is working now.

Thanks for having a look.

Best Regards,
Mesich


Report Offensive Follow Up For Removal

Response Number 3
Name: TopFarmer
Date: October 14, 2003 at 11:40:21 Pacific
Reply: (edit)

HI I'm not a programer but went to your hame page and http://www.duncan007.com/. Noticed a difference at the Address Bar. Your home page before the http:// it displays a black box with a N in it at other site it has the normal blue box with e in it.
Hope it helps some one to help you.


Report Offensive Follow Up For Removal

Response Number 4
Name: mesich
Date: October 14, 2003 at 11:50:44 Pacific
Reply: (edit)

Hi TopFarmer, hello everyone,

Always good to hear from you TopFarmer. I don't believe I am seeing the same thing you are. Here is a screenshot of what I see on the home page.

Best Regards,
Mesich


Report Offensive Follow Up For Removal

Response Number 5
Name: TopFarmer
Date: October 14, 2003 at 12:12:34 Pacific
Reply: (edit)

HI do not know if your home page is frames or not but the Address bar is different than the screen shot and this site. YOur home page:mesich.com @ http://home.insightbb.com/~mesich/
not http://www.duncan007.com/
hope it helps.


Report Offensive Follow Up For Removal


Response Number 6
Name: Infinite Recursion
Date: October 14, 2003 at 12:26:59 Pacific
Reply: (edit)

Hello. Your page http://www.duncan007.com/
is using frames, I suspect this is the main cause of your problem.

I noticed that when pressing F5 to refresh the page, regardless of where you are, you go straight to the main page (the intro). However, if you right click in any frame and choose refresh from the menu, it seems to work how you would like... refreshing the page that is being viewed.

I am not certain how to correct this problem, perhaps someone that dwells in the bowels of HTML or Java can provide more assistance. At the current time you can accomodate this problem by replacing your frame layout with a table layout, it would work how you would like but may be a bit excessive.

IR


Report Offensive Follow Up For Removal

Response Number 7
Name: Don Arnett
Date: October 14, 2003 at 12:30:07 Pacific
Reply: (edit)

Just a guess, but I'm wondering if the BODY tags in the top level file (the file with the FRAMESET and FRAME tags) is causing a problem. The code that I found for the site the I did with FRAMEs had the BODY tags surrounded by NOFRAME tags. I don't know if this is the problem or not, but it's worth a look.

Below is the NOFRAMEs code from my site (which is no longer up).

<NOFRAMES><BODY>

<H2>This is a frame-enhanced site</H2>
Please download a browser which supports frames before viewing this site.
</BODY></NOFRAMES>


Report Offensive Follow Up For Removal

Response Number 8
Name: mesich
Date: October 14, 2003 at 13:30:12 Pacific
Reply: (edit)

Hello everyone,

Thank you all very much for taking the time to look at this, it is appreciated very much.

Infinite Recursion,

Someone else had mentioned it was due to frames and that it was quite normal for this behavior.

This only confuses me more though because I, (we), have two other sites that are using frames and do not exibit this behavior.

mesich, which uses the exact same number and type of frames.

Family Photo's, which uses frames however, only two.

Don,

I shall give that a shot and post back in just a few.

Again thanks to everyone who has taken the time and shared their knowledge.

Best Regards to All,
Mesich


Report Offensive Follow Up For Removal

Response Number 9
Name: mesich
Date: October 14, 2003 at 13:39:18 Pacific
Reply: (edit)

Hello again everyone,

Don,

I tried pasting in the code on the index.html page as per your suggestion. Still no luck, I did however leave the code there so you could take a look if you have a moment.

Thanks again everyone,
Mesich


Report Offensive Follow Up For Removal

Response Number 10
Name: mesich
Date: October 14, 2003 at 13:53:51 Pacific
Reply: (edit)

Hello again everyone,

Here's a couple of other things I tried in isolating the problem.

I copied the index.html, menu.html, and title.html from mesich to Duncan007. No luck there in trying to isolate it to one of those.

Best Regards,
Mesich


Report Offensive Follow Up For Removal

Response Number 11
Name: TopFarmer
Date: October 14, 2003 at 16:47:20 Pacific
Reply: (edit)

HI again

Do not know if my broswer was not working correctly or you changed some codeing at YOUR site. at address bar no longer have the block box with N but the normal box with e before http://

looking at the two sites there is a difference on how you have the left window coded when view source. on all other panals except for Duncan's left for menu you do not have a <TITLE>Menu</TITLE> or what ever it shoud be. do not know if it matters :(


Report Offensive Follow Up For Removal

Response Number 12
Name: SN
Date: October 14, 2003 at 17:23:59 Pacific
Reply: (edit)

Mesich-
What a mystery! Very interesting thread. As you probably already know, the difference is not in the code. It looks like the web server on your mesich home page has some kind of sophisticated frame handling procedure that allows a refresh to work. Not only that, but it also manages to handle bookmarks better than other framed sites can. How it is doing it I have no idea, but it is friggin' impressive.

Check out the following two links:
copy of mesich page (just first and 3rd sidebar links work)
copy of duncan page(first and second sidebar links work)

You'll notice that both are exact copies of your websites (except without some of the files), and both behave entirely the same when you refresh or bookmark them. Try bookmarking one of those sites (on a page other than the default one), then bookmark the same page on your mesich one...You'll see that your bookmark takes you to the page you were on when you bookmarked it, while my copy takes you to the home page.

At first I thought maybe the server detected which page you last asked for if you happen to request a page with frames, and gives you that one. That theory was quickly destroyed when I visited some other pages on the site in an attempt to screw up the bookmark, but it still figured out which one I wanted. My props to the IT guys over at insightbb. They've got me beat.

As for the "N" in the address bar, my understanding is that if you put a particular icon file in the home directory, then when you bookmark or visit a page on that site, it replaces the standard E with that icon. I got the same N when I bookmarked your mesich site, but not when I browsed it. Check to see if there is a favicon.ico or some other ico file in the web directory.

I wish I understood how web servers work better than I do...I'd really like to know how all this is accomplished. I think IR, gpp, micah, and anonproxy have all had some experience with web servers, so maybe they have an idea on how this is done...

I also noticed that local copies of mesich and 007 on this windows 2000 box both refresh the correct page...make of it what you will.

Now to the workarounds...Many people use javascript or a server side script to figure out which page is supposed to appear in the frame. Some simple examples can be found here. The ones of interest are the "forcing a site into a frame" ones. The second one is slightly more robust, but also more complex. Any server side language can also do this, only a little "cleaner."

I'm still torn between using frames and tables, as IR suggested, but I think I'm the only one in this forum that is still holding out. Everybody else prefers the table method, for reasons outlined here.

All the preceeding is, of course, pure conjecture on my part and there may be a more simple explanation...Ghosts, for example. I tested all the pages in netscape 7.02 and IE 6 with identical results.

-SN
P.S. thanks for sticking up for me in my "battle" today...Always nice to see you windows forum guys visit us here in programming.


Report Offensive Follow Up For Removal

Response Number 13
Name: FishMonger
Date: October 14, 2003 at 18:32:56 Pacific
Reply: (edit)

I think the problem might be that you have two sets of body tags in the frameset definition file. Remove the outer set. This is our I have it written for my brother's site.

<frameset frameborder="0" framespacing="0" cols="200,*">
<frame NAME="TOC" NORESIZE target="Content" scrolling="auto" marginwidth="0"
marginheight="0" src="toc.html">
<frame NAME="Content" scrolling="auto" SRC="intro.html">
<noframes>
<body>
</body>
</noframes>
</frameset>
</html>


Report Offensive Follow Up For Removal

Response Number 14
Name: mesich
Date: October 14, 2003 at 20:37:38 Pacific
Reply: (edit)

Hello everyone,

Wow! What a set of replies.

TopFarmer,

Ooops! Forgot the Title in the menu page, thank you I shall correct that. Again, I apprecitate your help and time with this thread.

SN,

Very strange indeed. :-)

I shall drop an email to them, but as you know it may be quite some time before we get a response. Actually they are local, maybe I will get the right person when I call. :-)

My props to them also, along with yourself.

I shall check out your links on the work arounds first thing in the morning, about 3 hours from now. :-)

I shall also check out the link about tables you provided at the same time.

I see a lot of "Ghost" in Win98, WinXP, so I understand. :-)

Wasn't much of a battle, he went to a gunfight with a stick. :-)

In the hundreds, possibly thousands of threads I have responded to here on Computing.net, I normally don't respond to those. I couldn't help myself this time knowing your demeanor and reading his responses.

We like it when you programming guys stop by and visit us on occasion also. :-)

FishMonger,

Thank you very much for your reply also. I added the second body tag as suggested by a previous reply. I did not mean to place it as two Body's. :-(
I shall try replacing with your suggestion.

I must get a couple of hours sleep now but would like to say thank you very much to all that have sacrificed their time and shared their knowledge.

My very best wishes to you all,
Mesich



Report Offensive Follow Up For Removal

Response Number 15
Name: anonproxy
Date: October 14, 2003 at 20:49:20 Pacific
Reply: (edit)

So the issue is bookmarks. Why do some bookmarks go to the root document and others to the exact bookmarked page? And how are frames messing with our lives?

Well, these are all questions better forgotten, but its too late - I already bothered looking at this.

As Don mentioned, in the file mesich1.html (Windows site), the noframes tag is nested wrong. It should be outside the body tag. This alone might mess up a parser, because then the distinction between frameset and single entity document is violated (especially with your bookmarks) There are also two body tags. The top frameset tag is also opened but not closed. Definitely not up to XHTML spec, not even 4.01. Still though, HTML proves to care none for its own syntax and the browsers react equally without notice.

Next, we look at the file main.html (from that Duncan site). Not the same file, but all the same mistakes, including the double body tags. Next time copy the HTML from somebody, or from somebody else (as the case may be).

But the big problem I see unresolved with both files is the frameset tag nesting. This is how a frameset should look:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>TITLE</title>
</head>

<frameset >
<frame name="TOP" target="contents" src="HEADERFILE.htm">
<frameset cols=VALUES>
<frame name="contents" target="main" src="NAVIGATION.htm">
<frameset rows="VALUE">
<frame name="main" src="MAINCONTENT.htm" >
<frame name="main1" src="FOOTERFILE.htm" >
</frameset>
</frameset>
<noframes>
<body>

This page uses frames, but your browser does not support them.</p>

</body>
</noframes>
</frameset>

</html>

I just parsed that and the W3C (no arguments), with a few quibbles, called it OK. And, it bookmarks and reloads exactly as you would expect (to the frame you expect).

Now parse the file at www.duncan007.com (no arguments).
http://www.mirror.ac.uk/services/validator/check?uri=www.duncan007.com
And you thought I was critical.

And a parse of the Windows site, just to be thorough:
http://www.mirror.ac.uk/services/validator/check?uri=http%3A%2F%2Fhome.insightbb.com%2F%7Emesich%2F
The parser is once again unforgiving. Same errors. Different servers.

Now I have tried bookmarking the Duncan site and the Windows site on a non-root document frame. Both bookmarks return to the documents I bookmarked, not the root document. That seemed fine.

So I moved on to the reload function. The Duncan site reloads to the root document. The Windows site reloads to the document you would expect (the one you are viewing when the reload function is called).


So what are the differences?
Well, for the Duncan site there is no redirection by Apache. Netscape server on the Windows site does do a redirect - to the same location (wonder why we had all those problems with the old Netscape, eh? - kidding, the gateway server probably passes the request to another machine).

Frames are bad document handling because of the nature of different documents combined into one, but still bearing their uniqueness to the browser and the server. There should be object linking but there is not.

Now, I can get the same behavior with Apache as I do with Netscape, using my frameset example above. So its not intrinsically the servers (tried in Netscape, IIS, and Apache - 2 1.x versions), nor the fact that there is redirection. We know its not the browsers (tried IE [6.0.2800] and Mozilla [1.4], but regardless the different results are all viewed under IE). Also, the following mirror of the Duncan site gives the same results using a lower version of Apache:

http://www.sharingds.org/duncan/main.html

For my final test, I used a computer with a clean cache. Same results.

The only problem we have is with one set of HTML code at the Duncan site. What is going on with that code? They parse the same. Or do they!??!? I looked again with a glaring eye. One difference:

Quoted from the parser on duncan007.com:

///PARSER

Line 17, column 43:
<NOFRAMES><BODY>

<H2>This is a frame-enhanced site</H2>
Please download a browser which supports frames before viewing this site.
</BODY></NOFRAMES>

</BODY>

I double checked (and while I did that, the guy changed the HTML for the Windows site and cleaned up his markup - or else I am really paranoid). Straight copies, except for a carriage return.

So, no difference in code, but a difference in parse results (well, if he changed to code, while I was doing this, then the parse results would be different). So to all onlookers there is no difference.

The folder hierarchy is also different. Duncun007.com keeps all its frame files in the root directory (so does the Window site). Other sites put them in sub directories of the root folder. Even the examples the original poster cited have their frame files in sub directories. But not only that, the root document is not defined (for example you are not returned to index.html, only the address duncun007.com). When you click on a link, you don't get a new address in your bar.

The Windows site keeps these elements the same though. The history objects don't change between the two sites either.

So back to the parser. This last time with a parse tree - to hopefully see what only the parser sees.

Duncun007.com parse:
http://www.mirror.ac.uk/services/validator/check?uri=http%3A%2F%2Fwww.duncan007.com%2F+&sp=

Windows site parse:
http://www.mirror.ac.uk/services/validator/check?uri=http%3A%2F%2Fwww.duncan007.com%2F+&sp=

We see that the parser nests the noframe tag of duncun007.com in the body tag (but there are two body tags), but then closes it inside the outer body tag. In the Windows site and all other examples, the body is nested within the noframe tag or discluded from the parse (so I assume the noframe tag is discluded in these parses).

I'm done for now. Change that noframe tag the same way you did for the Windows site (hasn't changed as I write this last line).



Report Offensive Follow Up For Removal

Response Number 16
Name: anonproxy
Date: October 14, 2003 at 21:44:51 Pacific
Reply: (edit)

The relevant specifications:

HTML 4.01:

http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html

And here is the applicable part:

http://www.w3.org/TR/1999/REC-html401-19991224/sgml/framesetdtd.html

"This DTD [frameset] is identical to the HTML 4.01 Transitional DTD except for the content model of the 'HTML' element: in frameset documents, the 'FRAMESET' element replaces the 'BODY' element."

This is spec:

///FRAMESET DTD

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A frameset document with NOFRAMES</TITLE>
</HEAD>
<FRAMESET cols="50%, 50%">
<FRAME src="main.html">
<FRAME src="table_of_contents.html">
<NOFRAMES>

Here is the
non-frame based version of the document.

</NOFRAMES>
</FRAMESET>
</HTML>

///END FRAMESET DTD

Technically, when the frameset tag is included, you are not supposed to use a body tag at all. The inclusion of the body tag, outside and inside the noframes tag, in a frameset document makes two wrongs. These as well all know, need to long threads.



Report Offensive Follow Up For Removal

Response Number 17
Name: Dr. Nick
Date: October 14, 2003 at 23:40:38 Pacific
Reply: (edit)

Reading over this thread, I wondered if anyone was going to point out that when using a FRAMESET, the BODY tag should not be used. Kind of sorry anonproxy beat me to it, but just to add on to that, here's what O'Reilly has to say about it:

"Use the <frameset> tag in lieu of a <body> tag in the frame document. You may not include any other content except valid <head> and <frameset> content in a frame document. Combining frames with a conventional document containing a <body> section may result in unpredictable browser behavior."

I would try changing your frameset file to match the specifications. As others have mentioned, it also may be in your best interest to move to table based layout. This will fix your current problem, and also prevent future issues if you ever have to change your host.

While this can be a pain to maintain, for example if you want to change your side menu you have to change it on all your pages, there are other ways around this. You could look into server side scripting languages, however these have a decent learning curve, especially if you're new to programming.

One suggestion is two-fold. Redo your pages using tables. This fixes any current or future problems. Now incorporate server side includes (SSI). These allow you to reuse your HTML, such as your menubar, so that if you need to add a menu item, etc, you only need to change your one menu.inc include file, and the change will be reflected on all your pages.

Never having used SSIs before, I played a bit and after just a few minutes, got them working on my IIS server. It didn't require any changes in configuration, but your page must have the .shtml extention. I'm not real sure what you need to get them working on Apache, but here's what I did for IIS.

In each page of your site (again, using the *.shtml extension) you will have a table of sorts, perhaps with two columns and one row. One side will have your menu and the other the page's main content. To put SSIs to use, just do the following:

[!--#include virtual="[absolute path]/menu.inc" --]

This is how you tell the server to put the text in your SSI file into your webpage. Two things. First, change the [ and ] to < and >. This command looks like an HTML comment, but your web server should see it and parse it. Second, you must have the absolute path from the root of your site to your include. If your page is in a subfolder called 'MyPage' your path must show this, ie: "MyPage/menu.inc", even if the include is in the same directory as your .shtml file. If your include file is in the root, just use "/menu.inc".

Here's a page that very quickly and simply shows you a bit about SSIs.

So, a very bare bones example of a page that uses SSIs to show a menu and the pages main content, and allows for easy change of the menu follows:

<html>
<body>

<table width="50%" border=0>
<tr>
<td>
[!--#include virtual="path/menu.inc" --]
<td>
MAIN CONTENT
</table>

</body>
</html>

Now, in your menu.inc file, just put the code that's currently in your menu html file. Note that you cannot use document tags such as <head>, <body>, etc, but can use any style tags, etc.

Feel like I kind of rambled, but hopefully you get the idea, and maybe it will help you. Hope I didn't miss anything, but if anybody here has more experience with SSIs I'm sure they'll point out any mistakes I've made.


Report Offensive Follow Up For Removal

Response Number 18
Name: SN
Date: October 15, 2003 at 00:09:51 Pacific
Reply: (edit)

ap-So did you conclude that the bad HTML is actually what's causing this behavior? if not, what is? I think you said that the Netscape server is doing a redirect while the Apache ones are not...Is this the final answer?

"Now I have tried bookmarking the Duncan site and the Windows site on a non-root document frame. Both bookmarks return to the documents I bookmarked, not the root document. That seemed fine."

Something must have gone wrong in my original test. I got the same results here, so perhaps the bookmarking and refreshing problems are not as closely related as I thought.

"the folder hierarchy is different"

I can't imagine this has anything to do with it...I didn't see the point there. Can you explain?

The following version was validated with 0 errors on the w3:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
     <meta http-equiv="Content-Type" content="text/html; 
charset=windows-1252">
     <TITLE>Duncan007</TITLE>
</HEAD>
<FRAMESET rows="143,*">
    <FRAME src="title.html" name="banner" frameborder=0>
    <FRAMESET cols="20%,80%">
       <FRAME src="menu.html" name="menuwindow" scrolling="no" 
noresize frameborder="0">
       <FRAME src="home.html" name="mainwindow" scrolling="auto" 
noresize frameborder="0">
    </FRAMESET>
<NOFRAMES>
<H2>This is a frame-enhanced site</H2>
Please download a browser which supports frames before 
viewing this site.
</NOFRAMES>
</FRAMESET>
</HTML>

That is now the code that can be seen here. (Mesich - note that border="0" is not supported in the w3 spec, but is the only way to get what you want in IE or netscape...the "standard" frameborder="0" didn't work)

The problem persists, despite all possible invalid HTML deleted (at least as far as the w3 is concerned.)

So now I guess to see if it really is the servers or the code, put the same code up on to the insightbb server for your windows page and see if it makes a difference. My vote is still a difference between Netscape server and apache. Again, I have no idea how any server can figure out what page you were visiting on a frameset from a bookmark or a refresh, so if you have any insight into the internals there, I'm very interested.

"Now, I can get the same behavior with Apache as I do with Netscape, using my frameset example above. So its not intrinsically the servers (tried in Netscape, IIS, and Apache - 2 1.x versions), nor the fact that there is redirection."

I couldn't get the frameset you posted to work at all...I'm not sure what I'm doing wrong. The Target attributes kind of throw me off too. I'm interested to see if a valid version on the netscape server will still refresh to the correct page while my old apache server still brings it back to the root. I guess that will tell us the truth...

If I spent half as much time on my homework as I do on this forum...

-SN


Report Offensive Follow Up For Removal

Response Number 19
Name: mesich
Date: October 15, 2003 at 06:40:53 Pacific
Reply: (edit)

Hello everyone,

I've had a chance to brief over the responses this morning. I shall try all of the suggestions above when I return from a client in a few hours.

What I was able to accomplish this morning is removing the BODY tags.

This all started mostly out of curiousity and have learned much because of such.

I did quite a bit of reading yesterday on frames and from what I gathered it is not a good idea to use them if you are going after search engines.

I think using the tables may be the way to go here. I shall read the link provided about SSI's when I return also.

For the Duncan007 site I'm thinking it may be best to go with a standard page. It is only going to contain about 14 pages which will not be changed often.

For the Duncan Family Photo's I believe the frames are the best as we are not going after any search engines, and the frames do look much nicer.

For the Windows site, well I shall wait until my friend who helped out with building it returns from work in a few hours.

A very sincere thank you to everyone that has provided their time and knowledge.

I shall work on each suggestion and post back with the results of each seperately.

I shall try the code on the insight server as per SN's suggestion before I take off, as this will be quick and easy.

Best Regards to All,
Mesich


Report Offensive Follow Up For Removal

Response Number 20
Name: mesich
Date: October 15, 2003 at 07:45:30 Pacific
Reply: (edit)

Hello everyone,

SN,
I put the same code up on the insight server and it resulted in no changes.

Thank you again for your time and knowledge.

I shall respond to your other suggestions later this afternoon when I have a chance to perform them.

Anonproxy,

Thank you also for your time and knowledge.

I have changed the code on the page and now only receive one item from the validator.

Line 7, column 30:
<frameset rows="143,*" border="0">
Error: there is no attribute "BORDER"

As SN stated the frameborder="0", doesn't work so I am not sure what to do with this error.

I shall also post back with the rest of your suggestions along with the others.

Best Regards and Wishes to All,
Mesich



Report Offensive Follow Up For Removal

Response Number 21
Name: The Count
Date: October 15, 2003 at 15:47:52 Pacific
Reply: (edit)

Hi Mesich, Infinite Recursion, TopFarmer, Don, SN, FishMonger, anonproxy, Dr. Nick, hi everyone

Thank you all for the input, it's overwhelming. :-)
I fear I'll have to read it over a couple of times before I may have a clue of what you guy's are talking about, at this time. Must be the language barrier. ;-)

Here are some thoughts and facts from a simple minded: ;-)

When one does a refresh (F5) on the Windows site, the "active" page is refreshed.
With "active" page, I mean any page that is on display prior to refreshing. This goes for both the online pages as well as the original pages, (source files if you like) on my hard disk.

Mesich, in his original post wrote:
"It was working fine,..."
Of course it was, the same template (as far as I know) was used, as for the Windows site.
And as I wrote above, it works fine with both the online and the offline pages of the site. Recreating a few pages of the Duncan007 site, with the same template, it all works like it used to (should) when hitting the refresh button.

Note: I'm simply running Windows 98 with IE 5.5 SP2 and a couple of q-fixes, no Apache stuff, no ICS, no Netscape, no nothing as I don't need any of that stuff for straight forward HTML-pages with a very small amount of JavaScript.

Now what really troubles me is the part about adding a "active" page to the Favorites. Clearing the cache, and have the page to come back up at the specific page that what was added to the Favorites.
But what really makes me tear my hair out, is it comes back in the proper frame setting. Whilst when one directly links to one of the pages, like How-To Partition and Format a Hard Drive, it doesn't show up in the proper frame setting.
(http://www.home.insightbb.com/~mesich/format1.html)

These direct linking methods are oftenly used here at Computing.net and I think is also the way the search-engines operate. Could be wrong, of course, about the last part. :~)

To resolve this direct linking issue, I've been hunting down the net without success so far. :-(
There are enough scripts to "Break out of frames", but to "Get framed" that seems to be a different story.
Found two, that I thought to be useful/helpful, pieces of JavaScript but so far I haven't managed to get either one to work.

The first script is:
<script>
if (parent.frames.length==0)
//Change "index.htm" in the URL of your "mainpage"
window.location.replace("index.htm")
</script>

This either bumps me to the homepage or turns up with a directory listing.

The second script consists of two pieces:
Part 1 is to be placed in the "child" pages, and part 2 is to be placed in the "master.html" or as I see it in the "index.html".

Part 1:
<script language="JavaScript" type="text/javascript"> *added this myself.
passpage = document.URL
if (top.location == self.location)
top.location.href="master.html?" + passpage
</script>

Part 2:
<script language="JavaScript" type="text/javascript">

origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)

document.write('<frameset cols="20%,80%"><frame src="leftnav.html" name="nav"><frame src="' + contentURL + '" name="content"><\/frameset>')

</script>
Source: Little hard to get to, when writing this the source is to be found under the topic: handy, generic javascript coding, from there select the second page and look for a reply/post with the title: FORCE MANY PAGES INTO FRAMES by tedster.

This script, after some adjustments (expanding with one frameset rows="143,*" etc.), nicely showed the title, the menu and a empty mainwindow. Thus not including the directly linked page. :-(

If any of you would have a little time over and could check the above, little hard to get link, maybe you could explain this part to me:
THE MAIN IDEA
You can add ANY page's name to the end of a URL [after a "?"] Then you only need ONE frameset page to catch an indefinite number of orphan pages and put them into their frameset. This method offer very easy maintenance, especially when there are lots and lots of possible orphans for one frameset.

Mainly the bolded part is what I'm missing... [after a "?"] ???

I've a strong feeling that with the above script (part 2), direct linking and properly showing framed pages as intended could be solved for the many.

Thanks in advance for your input.

Greetz from The Netherlands,
The Count, Co-webmaster of mesich.com


Report Offensive Follow Up For Removal

Response Number 22
Name: The Count
Date: October 15, 2003 at 16:38:33 Pacific
Reply: (edit)

Hi everyone,

I would like to correct a few things regarding my previous post. :~)

Where I wrote:
"Note: I'm simply running Windows 98 with IE 5.5 SP2 and a couple of q-fixes, no Apache stuff, no ICS, no Netscape, no nothing..."

It should read:
Note: I'm simply running Windows 98 with IE 5.5 SP2 and a couple of q-fixes, no Apache stuff, no IIS, no Netscape, no nothing...

The provided link is incorrect, sorry.
The correct link is:
How-To Partition and Format a Hard Drive
(http://home.insightbb.com/~mesich/format1.html)

Forgot to mention the link to the topic/thread regarding the second script, only linked to it.
handy, generic javascript coding
(http://www.webmasterworld.com/forum21/page61.htm)

Once more thanks for your time and input.

Greetz,
The Count, Co-webmaster of mesich.com (October 16th, 01:38 hours)


Report Offensive Follow Up For Removal

Response Number 23
Name: anonproxy
Date: October 15, 2003 at 16:53:21 Pacific
Reply: (edit)

"ap-So did you conclude that the bad HTML is actually what's causing this behavior? if not, what is? I think you said that the Netscape server is doing a redirect while the Apache ones are not...Is this the final answer?"

Neither. I cannot prove it's the code (has been changed, no effect), the server, or the browser. I basically eliminated all the options, which points to a flaw and ultimate assumption somewhere on my part. Forget the redirection, that could not be reproduced for all tests.

You could call it on the server (we see it on all servers, so that isn't valid as it stands), but at that point I don't see why the browser wouldn't have an equal part (HTTP 1.1 goes both ways). The fact that it is on two seperate websites is entirely bizarre.

"I can't imagine [the folder heiarchy] has anything to do with it...I didn't see the point there. Can you explain?"

Servers have default behaviors pointing to URL's, which themselves point to documents. This comes into play when you request a folder, not a document, or if the configuration refers to a different document. Servers and browsers exchange URL's, but the browser may not know the exact document's URL, extension, etc (it should for a reload). This is why there is a root document in the root web directory. It was an observation.

Don't worry about the little parser errors. A parser is like an efficiency consultant - they're supposed to find something wrong. Just remember you have good tools freely availible. I would use CSS in the Duncan site (would look exactly the same). If you need better alignment, add a table. CSS can be funky, in IE of all browsers, but just don't be too creative (it's not flexible, but this is HTML).



Report Offensive Follow Up For Removal

Response Number 24
Name: SN
Date: October 15, 2003 at 18:11:39 Pacific
Reply: (edit)

ap-
Thanks for the answers to my questions. I've now officially decided I have no friggin' idea what is going on. Mesich said that duncan007 didn't change when he put it on the netscape server. I assume that means that the pages refreshed back to the "home" page rather than what the count is calling the "active" page. This leaves me at the same place as you...I've eliminated the browser (both sites refresh properly when I use local copies), the server, and the code. I went wrong somewhere, but I have a feeling I'll need more understanding of the internals of how these things work before I figure out where.

Good idea with the CSS. I wasn't sure if the border: 0 property would work with frames. We're all well aware of your angst toward IE and CSS :-) (three overlapping absolutely positioned divs, is it?)

Count-
The second approach you mentioned is the one I linked to in response number 12. I'm not sure where you got hung up, but I've (halfway) implemented something similar on my sharingds.org site. If you go to http://www.sharingds.org, you'll see that the site uses two frames, but you can link directly to a certain page by going to http://www.sharingds.org/index.html?poemsframe.html or http://www.sharingds.org/index.html?/buddywalk/index.html. This approach makes all refreshing and bookmarking work well, as well as fixing it so hits from search engines can navigate your site.

A piece of advice...Rather than putting the framing code in each document as you wrote, put it into a .js file and link to it:
<Script src="myscript.js">. This way should you decide to change something you don't have to change all pages. This mistake is why the fix is only "half" implemented on sharingds.org. I haven't put the js in any of the "child" pages.

I see that Duncan 007 has switched to tables. Sell out!!! :-) Come on, we were just starting to have fun! It's so rare to get a problem that most of us have some kind of background in so we can really put our heads together. I gotta admit, I didn't think a simple HTML problem would ever stump all of us.

HTH,
SN


Report Offensive Follow Up For Removal

Response Number 25
Name: FishMonger
Date: October 15, 2003 at 18:25:14 Pacific
Reply: (edit)

Hi everyone, thought I'd jump back in and add a little question & comment about the use of the <body> tags in the frameset definition file.

Does anyone know if it was ever valid to have those tags in the file? The code example I posted earlier was from the site I built (several years ago) for my brother. I put those tags into the file based on the book that I was using to learn Javascript (JavaScript Unleashed by Richard Wagner). So, either that book was wrong or the use of the <body> tags was removed from the standards. From your comments, it seams that I should at the very least remove them, but since I've never experienced any problems with the tags being there, I've never bothered to remove them or even check to see if there were or were not supposed to be used.


Report Offensive Follow Up For Removal

Response Number 26
Name: Dr. Nick
Date: October 15, 2003 at 18:32:08 Pacific
Reply: (edit)

Wow, this post really did take off. I've gotta think it's one of the largest so far on this forum.

Just curious. I mentioned server side includes earlier and I'd just like to know what your guys' opinions are about them. I've never tried to use them with Apache, but they seem to work pretty well with IIS. You can often do away with them by using server side scripting, but do you think they still have a place, or are they quickly becoming obsolete?

I guess a question is, would you use them in an application such as this, where you just want a static menu on multiple pages, but only want one menu file? Or would you just go ahead and script it somehow?


Report Offensive Follow Up For Removal

Response Number 27
Name: Dr. Nick
Date: October 15, 2003 at 18:38:37 Pacific
Reply: (edit)

FishMonger

If you look at my earlier post (#17), I have an excerpt from my O'Reilly book, Javascript: The Definitive Guide 3rd Ed.. From it and what I've seen other places, placing other HTML document 'management' tags such as <HTML> and <BODY> in a frameset document is at the very least, not recommended, and at most, is against the specifications. According to my book it can lead to "unpredictable browser behavior". Some browsers may simply ignore the extraneous tags, but maybe others, especially older versions, will have issues rendering the page.

As far as changing the specifications, I don't know about that. My book is dated June, 1998.


Report Offensive Follow Up For Removal

Response Number 28
Name: anonproxy
Date: October 15, 2003 at 20:36:14 Pacific
Reply: (edit)

"but I have a feeling I'll need more understanding of the internals of how these things work before I figure out where."

Don't waste any more time on this. Instead, read a book on parsing.
http://www.cs.vu.nl/~dick/PTAPG.html


"Does anyone know if it was ever valid to have those tags in the file?"

Originally, it was considered alright (i.e. who cares?), but the W3C saw the lack of consistency in this (the body tag was redundant, forcing the parser to do something unspecified with it), and just let the browser implementers figure it out. Then, they released their frameset DTD for compliance purposes. Largely, no one noticed.

"I mentioned server side includes earlier and I'd just like to know what your guys' opinions are about them."

They have been replaced by seperate parser modules like PHP and WML. Why tailor includes to a particular server (read: MS business strategy) instead of a language (more flexible, keeps binaries smaller for server, considers security, allows database access, etc)? Besides, you should seperate process from presentation whenever possible (admittedly, PHP is not really into that).

"Some browsers... especially older versions, will have issues rendering the page."

At least those browsers have the excuse of being older versions.


Report Offensive Follow Up For Removal

Response Number 29
Name: Infinite Recursion
Date: October 16, 2003 at 06:40:41 Pacific
Reply: (edit)

Dr. Nick:

To answer your question:
---
"Just curious. I mentioned server side includes earlier and I'd just like to know what your guys' opinions are about them."
---

I do not use server side includes. I mainly use PHP on my Apache web servers for most of my website development. After getting a grasp on PHP, most other web development languages that I once used seemed to have no bearing on what I wanted to do. On occasion, I use CGI, Perl, Javascript and of course HTML.

To answer your second question:
---
... do you think they still have a place, or are they quickly becoming obsolete?
---

I could see where they would have a place, for instance I would use them if PHP was not supported or could not be installed on the server that I happened to be working on. Or if the web developer did not know PHP and already knew how to develop server side includes... Personaly, I do not use them, but that does not mean they are obsolete; however, in the long run I would assume all programming languages in existance today will be replaced with something bigger and better - self modifying / debugging code, software engineering expert system, etc. The trick is to be flexible and willing to learn.
As I said, I am pro PHP... I am sure someone else here prefers to do the same tasks with server side includes.

To answer your third question:
---
"...would you use them in an application such as this, where you just want a static menu on multiple pages, but only want one menu file? Or would you just go ahead and script it somehow?
---

I would use a menu.inc written in PHP and where I wanted it... I would just include menu.inc. It makes no sense to have a website that has identical sections scattered about the content of the website, when you can just have one file that is included, be it via PHP or SSI. One file to maintain is the ideal solution, even if it is static - if it is a menu, it will change eventually.

----

As far as the frames problem, the original reason for this post, I would suggest using tables instead of frames. Even if SN calls you a sellout... --> "I see that Duncan 007 has switched to tables. Sell out!!! :-)" lol.

IR


Report Offensive Follow Up For Removal

Response Number 30
Name: Dr. Nick
Date: October 16, 2003 at 11:00:04 Pacific
Reply: (edit)

Yeah, that's what I was thinking. I've actually never used SSIs until this post, but I know our old company web site did. They seemed to offer a quick, if dirty, solution to part of the problem with going from frames to tables. I do agree that scripting it out would be better.

I'm having a go at PHP right now. Got book that someone here suggested, can't remember who now, but it is exceptional and I'm picking up PHP pretty quick. I like it because it's very powerful and yet very easy to grasp, especially if you have something like C++/Java under your belt.

Thanks for the reply.


Report Offensive Follow Up For Removal

Response Number 31
Name: The Count
Date: October 17, 2003 at 13:49:50 Pacific
Reply: (edit)

Hi Mesich, Infinite Recursion, TopFarmer, Don, SN, FishMonger, anonproxy, Dr. Nick, hi everyone

Thanks to you all again for your replies!
For me it's weekend, and I have the up coming week off, so I'll have more time to thoroughly go through it all once more.

SN
The two links you provided in response #24 do exactly what I'm looking for with the mesich.com site, thus direct linking to the pages.

Yesterday evening I've been looking into your source-code and couldn't find a major difference between what you used, and what I've been doing so far (off-line).
I did notice that you use the "forceFrame.js" instead of pasting the code directly into the "child" pages. I liked that, just like I liked the idea of CSS file.

I'm assuming you have this in your "forceFrame.js" file:

<script language="JavaScript" type="text/javascript">
     passpage = document.URL
     if (top.location == self.location)
     top.location.href="master.html?" +      passpage
</script>

And this in the "master.html" file:

<script language="JavaScript" type="text/javascript">

     origURL = parent.document.URL
     contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
     document.write('<frameset rows="143,*" border="0"><frame      src="title.html" name="banner" scrolling="no">')
     document.write('<frameset cols="25%,80%" border="0"><frame      src="menu.html" name="menuwindow" scrolling="no" noresize><frame src="' + contentURL + '" name="mainwindow" scrolling="auto" noresize><\/frameset>')

</script>

The above I've placed under the closing </HEAD> tag, and left the <BODY></BODY> tag empty (except for a )

Also I have created a "test.html" file, that contains a direct link to one of the off-line (source) pages of mesich.com.
The link I created is:
<a href="index.html?cdrommissing.html">CD-ROM&lt;/a>

When I click on the above link, from within the test page, the frames are build up correctly. :-)
The title page shows as does the menu page, but the "mainwindow" that should be displaying the cdrommissing.html file display's either a blank frame or the home page. :-(

Could you please tell me what I'm doing wrong here?

Thanks again in advance for your time and wisdom.

Greetz from The Netherlands (=Holland),
The Count


Report Offensive Follow Up For Removal

Response Number 32
Name: The Count
Date: October 17, 2003 at 14:08:16 Pacific
Reply: (edit)

Hi again,

I accidentally hit the submit button to early. :-{

As I also wanted to say that all the .html files are within the same folder/directory.

The good part of hitting submit to early is, that I now notice that a little bit of the code got messed up.
<frame src="title.html" name="banner" scrolling="no">
has only one space between frame and src="title.html" and not the amount shown above.

"The above I've placed under the closing </HEAD> tag, and left the <BODY></BODY> tag empty (except for a )"

This should read:

The above I've placed under the closing </HEAD> tag, and left the <BODY></BODY> tag empty (except for a <!-- comment --> )

And finally, as far as I noticed the errors in my previous post, the link is closed properly in the source-file.

Thanks again for patience. :-)

Greetz,
The Count (23:08 hours)


Report Offensive Follow Up For Removal

Response Number 33
Name: SN
Date: October 17, 2003 at 16:21:44 Pacific
Reply: (edit)

Count-
On behalf of the morons who wrote that book and the moron (who will remain unnamed) who trusted them, I apologize. Poor soul, had a rough week, haven't we?

parent.document.URL returns what you see in the address bar in netscape, but only everything up to the ? in IE. Both netscape 7.1 and IE 6.0 support the window.location.search property, which is better suited to this problem. The author also did not close his frameset properly.

What you have in your child pages is good. The master page should read:

<HTML>
<HEAD><TITLE>test</TITLE></HEAD>
<script language="JavaScript" type="text/javascript"> 

origURL = window.location.search; 
contentURL = origURL.substring(1);

document.write('<frameset rows="143,*" border="0">');
document.write('<frame src="test2.html" name="banner" 
scrolling="no">');
document.write('<frameset cols="25%,80%" border="0">');
document.write('<frame src="popup.html" name="menuwindow" 
scrolling="no" noresize>');

alert(contentURL);
document.write('<frame src="' + contentURL + '" name="mainwindow" 
scrolling="auto" noresize>');
document.write('</frameset></frameset>');
</script> 
</HTML>

(tested in ns 7.1 and ie 6.0)

Note that with full urls (http://...) this method is a little shifty because they may end up being encoded (spaces to +, ? to %3F, etc.) Feel free to only pass the page above the path to the page (ie /folder/mypage.html instead of http://www.mysite.com/folder/mypage.html). You should usually know exactly how many characters you need to take off the front to get that part.

Personally, I prefer server side redirection (pretty much the same thing, only the code above is in a perl or php kind of script). The advantages aren't major, but it just feels "cleaner" for some reason.

Finally, note that as far as I've been able to research, script isn't officially allowed except in HEAD or BODY, neither of which we can do here. Just in case problems come up later or if you try to validate it, figured you should know.

Hope this helps, and my apologies for not checking the author's work. Hope it didn't cause you too many headaches.

-SN


Report Offensive Follow Up For Removal

Response Number 34
Name: SN
Date: October 18, 2003 at 09:17:21 Pacific
Reply: (edit)

Whoops, I left my debug code in there...Take out the alert.

Also, I should have explained window.location.search. It returns the question mark and everything after it. For example, in the page:
www.mysite.net/index.html?mypage.html
window.location.search would return (?mypage.html)

the origURL.substring(1) is to get rid of the question mark. the second parameter (origURL.length) that we had used previously is not necessary.

-SN


Report Offensive Follow Up For Removal

Response Number 35
Name: The Count
Date: October 18, 2003 at 14:00:25 Pacific
Reply: (edit)

Hi SN, hi everyone

Thank you very much for sticking around with me. I, and believe me this also applies for Mesich, really appreciate it very much!

I've been trying the code you posted, and have made a little success. Now the "mainwindow" isn't showing the blank page anymore, but is still showing the home page instead of the requested page. :-(

I'm going to modify a online page in a few to test, and for you to be available to review (if you have a moment of course).

In the code you posted above I've changed:
frame src="test2.html" into

frame src="title.html"
and
frame src="popup.html" into

frame src="menu.html"

Are the above changes wrong?

I'm correct with placing the first part, the one you have in the "forceFrames.js" between the <HEAD> and </HEAD> tag's, right?

I'll be posting the URL to the modified page as soon I've made the changes to the online page.
If you have a moment please...

Thanks, again, in advance for your time, wisdom and patience.

Greetz,
The Count (23:00 hours)


Report Offensive Follow Up For Removal

Response Number 36
Name: The Count
Date: October 18, 2003 at 17:00:33 Pacific
Reply: (edit)

Hi Mesich, Infinite Recursion, TopFarmer, Don, SN, FishMonger, anonproxy, Dr. Nick, hi everyone

SN
I have now pasted the code into a "live" page, and uploaded the master-file. But that didn't make a change either. :-(
It's still showing the home page, as I talked about in my previous reply (response #35).

I'm considering of renaming home.html into welcome.html, not sure if that will do any good though.

Here is a direct link to the modified "child" page:
Cdrom missing in Windows
(<a href="http://home.insightbb.com/~mesich/index.html?cdrommissing.html">)

I've also uploaded plain text versions of the index.html, master.html and cdrommissing.html files. These files are temporarily stored here:
index.txt, master.txt and cdrommissing.txt
(http://www.dse.nl/~thecount)

Maybe you could review them and let me know, where I'm taking the wrong turn. :~)
My skull is beginning to hurt, of all the hair pulling. ;-)

All your help is appreciated.

Greetz,
The Count (October 19th, 01:50 hours)


Report Offensive Follow Up For Removal

Response Number 37
Name: SN
Date: October 18, 2003 at 18:40:47 Pacific
Reply: (edit)

Count-
I think this is just a simple error. You've been testing index.html, which has no javascript at all in it, when you mean to be testing master.html.

master.html is O.K. except you need to take out the line breaks where the forum wrapped them (that's why it gives an unterminated string constant error.)

You changed the frame sources correctly...So we have title, menu, and main...No place for index, right? So master and index are both framesets...master has the js and index doesn't.

I'll post more later. Gotta return a couch to the store.

-SN


Report Offensive Follow Up For Removal

Response Number 38
Name: The Count
Date: October 20, 2003 at 13:47:32 Pacific
Reply: (edit)

Hi Mesich, Infinite Recursion, TopFarmer, Don, SN, FishMonger, anonproxy, Dr. Nick, hi everyone

SN,

I hope you aren't still on your way to the store to return the couch. ;-)

I've made the changes according to how I interpreted your last post, if you could review the text files once more..., I think we are almost there. :-)

I've also uploaded the forceFrame.js file to both locations, the live site and my webstorage place (where the text files are located).

Sorry but I didn't quite understand what you meant with: "No place for index, right?"
Were you saying that index.html can contain both framesets? If so, how? %-)
I've been playing around with inserting the js into index.html but without luck. The "mainwindow" either showed the blank page or the home page. :-(

I suppose I'll be asking to much if there is a way to instead of inserting direct links as:

<a href="http://home.insightbb.com/~mesich/master.html?cdrommissing.html">Cdrom missing in Windows</a>

to be able to insert them as:

<a href="http://home.insightbb.com/~mesich/?cdrommissing.html">Cdrom missing in Windows</a>.

It would be even better if we could get rid of the question mark, and still have the requested page to be loaded in it's proper frame setting :-)

As you can see, I don't want to give up on the frames. :-)

And I do have one other question, if I may: How do search engines deal with the "child" pages, after the needed modification (inclusion of forceFrame.js) has been made, and the META tags are inserted? Any thoughts?

Your time, wisdom and patients is greatly appreciated.

Greetz,
The Count


Report Offensive Follow Up For Removal

Response Number 39
Name: SN
Date: October 21, 2003 at 19:26:00 Pacific