Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

javascript help

Thread Tools
 
Search this Thread
 
Old Jan 3, 2002 | 02:31 PM
  #1  
Markus's Avatar
Markus
Thread Starter
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Post

my site uses the cascading popup menus from this site. and cool they are.

here is my problem. I want to put the menu in a frame, and have the contents shown in another frame. This is easy, Angus has how to do this here

Here's my problem though. Say I wanted to post a direct link to a page, for example, my morette lights pictures. At present I can do this as each page loads the menu code. with the frameset version you'd have to come in on the main page to get the frames setup, if you were to go to sub pages you'd get an error, because the menu frame/code is no present.

So, would it be possible to have a javascript that I could load on each page, check to see if the page is framed, and/or check if menuframe and main frames are there, if it finds no frames then create frames, put menu in the menuframe, then put the page that was being called into the main frame?

is this possible? any javascript experts out there that can help.

cheers
Reply
Old Jan 3, 2002 | 07:10 PM
  #2  
legacyPete's Avatar
legacyPete
Scooby Regular
 
Joined: Dec 2001
Posts: 202
Likes: 0
Lightbulb

try this:

if(top == self)
{
top.location = "http://www.markuswarren.co.uk/";
}

Put this on your pages (apart from index/default), or put it in a .js file and add a link to it on the pages that need it.
However, this will not put the page into the mainframe like you wanted; to do this you need to have the use of PHP/ASP/something similar on your site.
Reply
Old Jan 4, 2002 | 09:12 AM
  #3  
Markus's Avatar
Markus
Thread Starter
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Post

cheers.
have been playing around with some JS stuff. basically using;

var howmany = frames.parent.length

which gives me the number of frames, if it's zero then i was doing a document write structure to write the html to create the frameset and load the pages, which seems to work. got to check some stuff to make sure but think it might be a winner.
Reply
Old Jan 4, 2002 | 04:13 PM
  #4  
netclectic2's Avatar
netclectic2
Scooby Regular
 
Joined: Mar 2001
Posts: 218
Likes: 0
Post

i would say... don't use frames!

they are far more hassle than they are worth (IMHO).

Reply
Old Jan 4, 2002 | 04:14 PM
  #5  
Damaja's Avatar
Damaja
Scooby Regular
 
Joined: Nov 2001
Posts: 1,783
Likes: 0
Post

IMHO the language of HTML sucks! BIG TIME!
Reply
Old Jan 4, 2002 | 04:19 PM
  #6  
Markus's Avatar
Markus
Thread Starter
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Post

yeah, thinking of just sticking with what I've got. Bug thumbs up to Angus though, (guy who wrote the menu system), got reply from him about how to do it, and apart from one point, cos I'm thick, it looks like it would work.

Think I'll stick to just my current no frames setup though.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
StickyMicky
Computer & Technology Related
3
May 22, 2004 03:02 PM
CodeKey@Lisan
Computer & Technology Related
11
Feb 20, 2004 05:23 PM
RichB
Computer & Technology Related
2
Nov 5, 2003 02:27 PM




All times are GMT +1. The time now is 10:33 AM.