Basic Java scipt question?

Discussion in 'Programmer's Corner' started by rougie, Aug 19, 2012.

  1. rougie

    Thread Starter Active Member

    Dec 11, 2006
    410
    2
    Hello,

    In notepad I created a file called "indexScriptVars.html" and it contains the following code:

    ====================
    <script type="text/javascript">
    var name="Tony";
    alert(name);
    name="bob";
    alert(name);
    </script>
    ====================

    After the line 'name=bob', why does the alert display a check box saying:

    "Prevent this page from creating additional dialogues" ???

    as show in the attachment below??

    r
     
  2. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    My guess:

    Since you are displaying two nearly equal alert boxes. The browser ask if you will continue to display those alerts. I think it's an browser issue, not a code issue.

    BTW: Why is not bob with capital B...?
     
  3. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    This is because there used to be annoying pages which showed like 50 of these boxes one after another saying some stupid message, until they finally let you go, so this way you can stop it in the beginning. Older browsers will not do this.
     
  4. rougie

    Thread Starter Active Member

    Dec 11, 2006
    410
    2
    Hi kubeek,

    Is there any way to turn this feature off in google chrome...? God knows I tried but couldn't find it !!!

    r
     
  5. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    I never looked for it, but I doubt it is possible to turn off. Why does it bother you?
     
  6. rougie

    Thread Starter Active Member

    Dec 11, 2006
    410
    2
    Naaaaaaaa! Not really!

    But thanks anyways!

    R
     
Loading...