I am trying to pass a number to my JavaScript function, but actually a wrong value is getting passed. I am giving the entire code here:
<html>
<head>
<script type="text/javascript">
function test(num)
{
/*It should alert as 01004 or 1004 but to my surprise it's alerting as 516!*/
alert(num);
}
</script>
</head>
<body>
<a href="javascript:test(01004);">Test it!</a>
</body>
</html>
In the above code, instead of 01004, if I pass it as 10040 I am getting the correct value in the alert box.
Any idea about this strange case?
Thanks in advance.