Hi,
I looked at some of the other global var threads( from a search query) they didn't seem to help.
I have a site that's using frames. There's a menu frame, a header frame and body frame. The menu and header frame have one html page that never changes. The body frame changes pages for different areas of the site. No biggy
EACH and EVERY page has this at the top:
<SCRIPT LANGUAGE="JavaScript" SRC="cthc.js">
So they are all using ONE single javascript -
At the top of this script I have what i want to be a Global variable used to track which page is currently loaded in the body frame
var current_area = '';
Now I have a function called ... of all things
function setCurrentArea(whosThereNow){
current_area = whosThereNow;
}
On any of the web pages that load into the body frame, I call this function to set the Global variable so it should know or be set to which ever page is currently in the body frame - something like:
<BODY BGCOLOR="#EDF6C9" onLoad="setCurrentArea('body');">
-- Now here's the problem, in other functions I want to evaluate or test this variable to see what page is loaded in the frame -- BUT IT DOESN'T WORK
if (current_area == 'body'{
//do some cool stuff
}
It always is NULL or '' -
HOW HOW HOW Can I set a global variable with a function call from a page in the body frame - and really have it set globally - then when I call a different function from a
page in a different page it really is honestly set.
Thanks In Advance!!!! ~Just Say When~
I looked at some of the other global var threads( from a search query) they didn't seem to help.
I have a site that's using frames. There's a menu frame, a header frame and body frame. The menu and header frame have one html page that never changes. The body frame changes pages for different areas of the site. No biggy
EACH and EVERY page has this at the top:
<SCRIPT LANGUAGE="JavaScript" SRC="cthc.js">
So they are all using ONE single javascript -
At the top of this script I have what i want to be a Global variable used to track which page is currently loaded in the body frame
var current_area = '';
Now I have a function called ... of all things
function setCurrentArea(whosThereNow){
current_area = whosThereNow;
}
On any of the web pages that load into the body frame, I call this function to set the Global variable so it should know or be set to which ever page is currently in the body frame - something like:
<BODY BGCOLOR="#EDF6C9" onLoad="setCurrentArea('body');">
-- Now here's the problem, in other functions I want to evaluate or test this variable to see what page is loaded in the frame -- BUT IT DOESN'T WORK
if (current_area == 'body'{
//do some cool stuff
}
It always is NULL or '' -
HOW HOW HOW Can I set a global variable with a function call from a page in the body frame - and really have it set globally - then when I call a different function from a
page in a different page it really is honestly set.
Thanks In Advance!!!! ~Just Say When~