Reply
Strange Cookie Problem with Firefox
Old 09-15-2006, 05:48 AM Strange Cookie Problem with Firefox
Novice Talker

Posts: 9
Name: Rhys Wynne
I'm designing a website that, by law, needs a confirmation method before opening. I'm using javascript because it doesn't harm the site's search engine ranking. It's very simple code that will display the confirmation box once, and then never again that session, should the user accept. The code works in IE but not in Firefox. Below is the code.


HTML Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--

function checkCount() {

    if ( !document.cookie.length )
    {
        input_box=confirm("Click OK or Cancel to Continue");
        
        if (input_box==true)

        { 
            // Output when OK is clicked
            document.cookie = 'popup=no';
        }

        else
        {
            // Output when Cancel is clicked
            window.location = "http://www.google.co.uk";
        }
    }
    

}

End -->
</script>
</head>


<BODY OnLoad="checkCount()">

<p>Page!<p>
</body></html>

The problem lies within the cookie, as the alertbox works fine within firefox. I suspect it's within the !document.cookie.length, and the way Firefox handles session cookies. I could be wrong though. Is this a known issue with firefox, if so, is there a way around it?

Thanks for any assistance I recieve.
rhyswynne is offline
Reply With Quote
View Public Profile Visit rhyswynne's homepage!
 
When You Register, These Ads Go Away!
     
Old 09-15-2006, 10:53 AM Re: Strange Cookie Problem with Firefox
funkdaddu's Avatar
Web Design Snob

Posts: 636
Well the "End -->" could be screwing things up, as "End" doesn't need to be there. It would generate an error.
__________________
Will Work For Talkputation...
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 09-15-2006, 10:59 AM Re: Strange Cookie Problem with Firefox
Novice Talker

Posts: 9
Name: Rhys Wynne
Doh! Thank you so much!
rhyswynne is offline
Reply With Quote
View Public Profile Visit rhyswynne's homepage!
 
Reply     « Reply to Strange Cookie Problem with Firefox
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13182 seconds with 13 queries