javascript help
#1
Scooby Regular
Thread Starter
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
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
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
#2
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.
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.
#3
Scooby Regular
Thread Starter
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
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.
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.
#6
Scooby Regular
Thread Starter
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
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.
Think I'll stick to just my current no frames setup though.
Thread
Thread Starter
Forum
Replies
Last Post
CodeKey@Lisan
Computer & Technology Related
11
20 February 2004 05:23 PM
RichB
Computer & Technology Related
2
05 November 2003 02:27 PM