W3C home > Mailing lists > Public > www-html@w3.org > August 2000

RE: linking in frames

From: Eric Costello <eric@schwa.com>
Date: Thu, 17 Aug 2000 09:40:25 -0500
To: "Catherine Sherman" <catherine_sherman@hotmail.com>, <www-html@w3.org>
Message-ID: <NEELIJPJGLONEACJAECIGEEOEKAA.eric@schwa.com>
>From an OUTSIDE DOCUMENT, I would like to create a hyperlink
>that loads my frames page, and loads a specific page into
>the main content frame.

There is no built in mechanism in HTML for that. It can be done, but it
takes work. The easiest and best way is to use some server side processing,
passing a parameter to your frame page (like
"frame.asp?content=desiredPage.html") which builds the frameset with the
value of "content" for the src of the main content frame. This can be done
in any server side processing environment, like ASP, CGI, PHP, CFM, etc.
etc.

If you can't use server side code, this can also be accomplished with
Javascript running client-side. Same idea, you pass a parameter in the URL,
but in this scenario you would use Javascript to document.write the frameset
with the value of "content" for the src of the main content frame. Requires
the user have Javascript on, but can be written to degrade without errors,
but also without the desired content on the main content frame.

I have also seen it done where you link directly to the html page you want
loaded in the main content frame. In that HTML page you add a little
Javascript that can tell if it is loaded in the proper frameset, and if not,
reloads the document with the "frame.asp?content=content.html" URL. You then
of course have to use one of the techniques above to get the frameset drawn
with the correct src for the main content frame

HTH,
Eric

Eric Costello


Eric Costello
eric@schwa.com
http://glish.com
Received on Thursday, 17 August 2000 10:42:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:43 GMT