Ok, I know that there is bound to be somebody out there that is a whiz with
this stuff. Here is the situation. I have a frames page web site and the
owner wants to have a script in the top of each of the "Body" pages that if
you come directly to one of those it tests the location bar and sends you to
the opening page so that the user is then in frames. I wrote a simple
script for this and it works great. Now the challenge is to extend that so
that it sets a cookie, using JavaScript, with the value of the page that the
user is on. Then in the Frames page that sets every thing up for it to read
the cookie and send load the "Body" section of the frames with the value of
the cookie. If the value of the cookie is not there then it needs to
default to the real opening main page. Included below are two pieces of
script that I have worked up but I am over my head from here and need some
help badly.
This is the script to jump to the home frames page
<script language="Javascript">
<!--
if (location.href == top.location.href) {
location.href = "index_test.cfm"
}
// -->
</script>
This is what I did to the above script to set the cookie (I hope)
<script language="Javascript">
<!--
if (location.href == top.location.href) {
var checktoploc = document.cookie;
function setCookie(name, value) { // use: setCookie("name", value);
if (value != null && value != "")
document.cookie = name + "=" + test.htm;
checktoploc = document.cookie; // update checktoploc
}
location.href = "index_test.cfm"
}
// -->
</script>
Now in the frames page it's self I need to check that cookie and write the
value of it out.
<script language="Javascript">
<!--
function getCookie(name) { // use: getCookie("name");
var index = checktoploc.indexOf(name + "=");
}
// -->
</script>
<script language="Javascript">
<!--
document.write('index');
// -->
</script>
As you can imagine and see though, document.write just returns the word
index on my page. What am I doing wrong here. What's the best method to do
this and write it into the frames page. Does anybody need to see the frames
page to be able to help more.
Thanks.
Bill Killillay
ICQ @ 8425781
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
"An investment in Knowledge always pays the best interest."
-Benjamin Franklin-
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Get Paid to Surf the Web. It's free, easy and fun.
Sign up for AllAdvantage.com at
http://alladvantage.com/go.asp?refid=FIB-034
Most of us are on it every day all day anyway, why not give
yourself a pay raise for 25 hours a month.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.