Click to See Complete Forum and Search --> : ?hide javascript document cookie window
:( I have created an all FlashMX site broken into scenes. I have used java script so that when you leave the scenes within the same day you are taken back to the scene you left instead of back to the intro each time. My problem is I am getting a browser window upon entering each scene. The header is Javascript document cookie then the body is scene= Az or whatever scene you have entered. These windows are annoying.. how do I hide them? All suggestions are welcome. I am so close to having the site I envisioned.
Sin
AdamGundry
01-09-2003, 11:28 AM
Reading cookies should not cause a new window to appear - it's probable there is a mistake in the code. You'll need to post the code or preferably a link to the site so we can examine it.
Adam
Ok. Let me put it on the web and you can take a look at it.
I will also post the script. Give me a few minutes. THANK YOU!!!:p
Premiere (http://www.ozwebdesign.com)
my first scene first frame code:
<script LANGUAGE="JavaScript">
<!-- Hide me;
function cookiesetup() {
var selectedItem = document.redir.community.selectedIndex;
var selectedItemValue = document.redir.community.options[selectedItem].value;
var exp = new Date();
CookieArray = new Array();
CookieArray = Scene.split( ';');
Scene = CookieArray[0].substr( 0, 6 );
if (selectedItemValue == "0") {
if (Scene == "Index") Frame = 135;
else if (Scene == "Convention") Frame = 138;
else if (Scene == "References") Frame = 140;
else if (Scene == "Services") Frame = 230;
else if (Scene == "Contact") Frame = 231;
else if (Scene == "Az Weather") Frame = 232;
else Frame = 135;
return false;
}
exp.setTime(exp.getTime() + 315360000000);
document.cookie = "coxwebmail=" + escape(selectedItemValue) + "; path=/; domain=webmail.cox.net; expires=" + exp.toGMTString();
window.open('http://webmail.cox.net/wwwredir/popup.htm','coxpopup', 'directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no,height=400,width=300');
return true;
}
// Hide done -->
</script>
}
Scene 2 code (repeats on each scene)
stop();
<script LANGUAGE="JavaScript">
<!-- Hide me
getURL("javascript: document.cookie = 'Scene=Index'");
// Hide done -->
</script>
}
Please bear with me this is all self inflicted code. I have no training. :(
AdamGundry
01-09-2003, 02:19 PM
I have looked at your site, and I believe it is probably the getURL function calling incorrectly. Try using this:
getURL("javascript:document.cookie = 'Scene=Index'; return false;");
Note the spaces which have been removed, and the addition of "return false", which should prevent the browser attempting to follow the code as an URL.
Hope this solves your problem
Adam
P.S. You might want to consider optimising your site for speed - it took several minutes to download the Flash, even on an ADSL modem, and most users would not wait that long.
Thanks. I have a book on optimizing the speed and that is the next venture for this site. A long learning experience but what a fun trip. Thanks for the help. I will try it right away.
Sin:D