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 03 January 2002, 02:31 PM
  #1  
Markus
Scooby Regular
Thread Starter
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
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
Old 03 January 2002, 07:10 PM
  #2  
legacyPete
Scooby Regular
 
legacyPete's Avatar
 
Join Date: Dec 2001
Posts: 202
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 04 January 2002, 09:12 AM
  #3  
Markus
Scooby Regular
Thread Starter
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 04 January 2002, 04:13 PM
  #4  
netclectic2
Scooby Regular
 
netclectic2's Avatar
 
Join Date: Mar 2001
Posts: 218
Likes: 0
Received 0 Likes on 0 Posts
Post

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

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

Old 04 January 2002, 04:14 PM
  #5  
Damaja
Scooby Regular
 
Damaja's Avatar
 
Join Date: Nov 2001
Posts: 1,783
Likes: 0
Received 0 Likes on 0 Posts
Post

IMHO the language of HTML sucks! BIG TIME!
Old 04 January 2002, 04:19 PM
  #6  
Markus
Scooby Regular
Thread Starter
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
StickyMicky
Computer & Technology Related
3
22 May 2004 03:02 PM
CodeKey@Lisan
Computer & Technology Related
11
20 February 2004 05:23 PM
RichB
Computer & Technology Related
2
05 November 2003 02:27 PM



Quick Reply: javascript help



All times are GMT +1. The time now is 09:04 AM.