Popup windows

Discussion in 'Javascript' started by Paul, Aug 14, 2003.

  1. Paul

    Paul Guest

    I have this code on my index.php page. It works when cookies are switched
    off but gets stuck in a loop when cookies are enabled. I think I know why,
    its looping as I have defined the page that the user is already on as the
    destination page if cookies are enabled. I thought this would work ok and
    not get stuck in a loop. So, is there any way I can get this to work? I want
    the user to remain on the index.php page but just be warned that cookies
    have been disabled.

    <SCRIPT LANGUAGE="JAVASCRIPT">
    <!--
    var tmpcookie = new Date();
    chkcookie = (tmpcookie.getTime() + '');
    document.cookie = "chkcookie=" + chkcookie + "; path=/";
    if (document.cookie.indexOf(chkcookie,0) < 0)
    {
    alert("Your browser is set to reject cookies, you must enable them to
    use this website");
    }
    else
    {
    window.location = 'index.php';
    }
    //-->
    </SCRIPT>
    Paul, Aug 14, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9obiBXYWxrZXI=?=

    Popup Window Popup Timing

    =?Utf-8?B?Sm9obiBXYWxrZXI=?=, Nov 4, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    842
    =?Utf-8?B?Sm9obiBXYWxrZXI=?=
    Nov 4, 2005
  2. dapkniht
    Replies:
    1
    Views:
    1,330
    Eliyahu Goldin
    Mar 8, 2006
  3. Rajesh
    Replies:
    0
    Views:
    540
    Rajesh
    Jul 31, 2007
  4. Urs Gubler
    Replies:
    0
    Views:
    151
    Urs Gubler
    Jul 2, 2003
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    520
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page