Can someone help me understand why this is happening?

Posted by Juan Manuel Formoso on Stack Overflow See other posts from Stack Overflow or by Juan Manuel Formoso
Published on 2009-05-08T18:12:51Z Indexed on 2010/05/13 17:34 UTC
Read the original article Hit count: 153

I just run into the weirdest thing I've ever encounter.

Consider this test page:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <script language=javascript>
        function test(myParameter) {
            alert(myParameter);
        }
    </script>
</head>
<body>
    <input type="button" value="Strange" onclick="javascript: test(044024);" />
    <input type="button" value="Ok" onclick="javascript: test('044024');" />
</body>
</html>

If I click the "strange" button, I get 18452, if I click the "ok" button I get 044024

Does anyone know what is happening and explain it to me?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about parameters