question about eval

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yawnmoth

    question about eval

    <script>
    a = "zzz:\nalert(1) ";

    eval(a);
    </script>

    Why does that work? This doesn't (not that I'd expect it to):

    <script>
    zzz:
    aert(1);
    </script>

    So why does the first script work when the second one doesn't?
  • Krukow

    #2
    Re: question about eval

    On 1 Mar., 18:32, yawnmoth <terra1...@yaho o.comwrote:
    <script>
    a = "zzz:\nalert(1) ";
    >
    eval(a);
    </script>
    >
    Why does that work? This doesn't (not that I'd expect it to):
    >
    <script>
    zzz:
    aert(1);
    </script>
    >
    So why does the first script work when the second one doesn't?
    Because you misspelled alert?

    Comment

    Working...