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. Advertisements

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:
    1,109
    =?Utf-8?B?Sm9obiBXYWxrZXI=?=
    Nov 4, 2005
  2. dapkniht
    Replies:
    1
    Views:
    1,530
    Eliyahu Goldin
    Mar 8, 2006
  3. Dr. X
    Replies:
    1
    Views:
    587
    Saravana
    Jul 22, 2003
  4. Rajesh
    Replies:
    0
    Views:
    816
    Rajesh
    Jul 31, 2007
  5. Urs Gubler
    Replies:
    0
    Views:
    315
    Urs Gubler
    Jul 2, 2003
  6. David Graham

    how do you only allow a popup to popup once

    David Graham, Nov 18, 2003, in forum: Javascript
    Replies:
    4
    Views:
    241
    kaeli
    Nov 18, 2003
  7. Alex Shinn

    mac ie popup of a popup security error

    Alex Shinn, Feb 19, 2004, in forum: Javascript
    Replies:
    1
    Views:
    179
    Alex Shinn
    Feb 19, 2004
  8. Jens Peter Hansen
    Replies:
    7
    Views:
    877
    Randy Webb
    Jun 19, 2004
Loading...