Solved

Subpages and Frames...

Posted on 1998-05-05
9
208 Views
Last Modified: 2013-12-25
When you first come to my site, I have three frames set up.  A banner up top, table of contents on the left, and the main on the right.  My question is this, is there anyway for me to access a subpage directly and have the frames load?  The reason I'm asking is because I'd like to submit my subpages to the search engines, and when the user clicks on the link, have the frames load, and then the subpage load in the main frame.  If this sounds confusing let me know.  Thanks for the help!
0
Comment
Question by:ingenito
  • 4
  • 3
  • 2
9 Comments
 

Author Comment

by:ingenito
ID: 1855312
Here's another way of putting it.  The user searches on a search engine for videos.  They see a link to my site about Windows Videos.  How can I have the user click on the link and have the frames load with the Windows Video information and not just to my main page?  I am willing to use Javascript but I don't want a seperate frame source on each page (I have over 200 pages) nor do I want a cgi script to do it.  Is there any way to do this?
0
 
LVL 3

Accepted Solution

by:
percyn earned 250 total points
ID: 1855313
Yes.
    You have to check the number of frames (frames.length) on each page and if the frames.length<1, then load the frameset by using location.href="myframeset.html"


0
 

Author Comment

by:ingenito
ID: 1855314
I'm sorry, but I don't understand.  Are you saying to put this code on every 'content' page to check for the frames?  If you are, then wouldn't the location.href="myframeset.htm" load the main page? I'm very familiar with javascript.  If you could, an example would be great.
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1855315
It seems you could put something like this in each of your subpages:

--//--
<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="Javascript"><!--
      if(!self.parent) self.location.href = "myFrameset.htm";
    // --></SCRIPT>
  </HEAD>
  <BODY>
    ...
  </BODY>
</HTML>
--//--

Is this what you meant?

-julio
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 5

Expert Comment

by:julio011597
ID: 1855316
BTW, i guess this is what percyn also meant... but, shouldn't be: top.frames.length?
0
 
LVL 3

Expert Comment

by:percyn
ID: 1855317
Yes,
    Check the top.frame.length and if it is <1, load up a frameset. How remember that you can load a frameset which loads one static page (like a menu) and another page which uses Script or CGI/ASP to accept a frame src as a passed parameter. Thus if you have 200 pages, you dont need 200 framesets, just one frameset, which can accept an argument to load any of the 200 frames.
0
 

Author Comment

by:ingenito
ID: 1855318
Since I want the content pages to be submitted to the search engines, I can't have it be a CGI script.  I think I figured it out though, please tell me if this implementation is practical.

On each of the pages I have added this just before the body tag:

<script language="javascript">
<!--

if(!top.frames.length){
document.writeln('<frameset framespacing="0" border="false" frameborder="0" rows="65,*">');
document.writeln('  <frame name="banner" scrolling="no" noresize target="contents" src="../../banner.htm" marginwidth="0" marginheight="0">');
document.writeln('  <frameset cols="192,*">');
document.writeln('    <frame name="contents" target="main" src="../../contents.htm" scrolling="no" noresize marginwidth="0" marginheight="0">');
document.writeln('    <frame name="main" src="account.htm" scrolling="auto">');
document.writeln('  </frameset>');
main.location.href="account.htm";
}

<!-- end of script -->
</script>

Now, this seems to work perfectly in MSIE 4.0 but not Netscape.  Can someone tell me why?
0
 
LVL 3

Expert Comment

by:percyn
ID: 1855319
top.frames.length is an int, not a boolean. Check for the exact value, i.e. 0,1,2,3, etc.



0
 

Author Comment

by:ingenito
ID: 1855320
It still doesn't work, if you'd like the page URL is http://www.corporatetrain.com/software/accounting/account.htm

Please take a look and let me know if you can tell what's wrong...
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add the word "MENU" to hamburger navigation icon in wordpress 8 63
GPS save in database 19 58
modify h2 4 82
Any Third party toll for Integrating chat system on ASP.NET ? 2 34
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now