Gossamer Forum
Home : General : Internet Technologies :

Stupid javascript problems :(

Quote Reply
Stupid javascript problems :(
Hi,

Got a really annoying problem :/

I use 2 different types of framesets;

1)

Code:
---------------------
| | <---------- TOPMAIN
---------------------
| |
| | <---------- MAIN
| |
---------------------

Then, inside MAIN, I have;

Code:
BROWSERSIDE
#
#
#
|
---------------------
| | |
| | | <---------- BROWSERMAIN
| | |
---------------------

When using ONLY the above frameset, then this works fine;

Code:
var ContentUrl = top.frames['BROWSERMAIN'].location;

However, if loading the first frameset first, and then the above INSIDE "MAIN", I can use this fine;

Code:
var ContentUrl = top.frames['MAIN'].frames['BROWSERMAIN'].location;

However, when I put this in, and then try accessing it via just the BROWSERSIDE and BROWSERMAIN frameset, I get an error saying;

Quote:
Error: top.frames.BROWSERMAIN has no properties
Source File: http://www.domain.co.uk/editors/pages/tree/menu_ACULEGAL_0.467601555007608.js
Line: 4

I guess what I really need, is a way to figure out if they are accessing it from the main frameset, or just loading it themselves.

So again, just to clarify...

..this works when in a double frameset (i.e a frame inside the main frame);

Code:
var ContentUrl = top.frames['MAIN'].frames['BROWSERMAIN'].location;

.. but this doesn't (although it works fine if loading it in a single frameset);

Code:
var ContentUrl = top.frames['BROWSERMAIN'].location;

I've been banging my head over this for days and days... so *any* suggestions/ideas are much appreciated :)

TIA

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

Last edited by:

Andy: Sep 21, 2005, 8:52 AM