Possible Duplicate:
Workarounds for JavaScript parseInt octal bug
well i have this
http://jsfiddle.net/gMDfk/1/
The alert returns 0
The code in jsfiddle works perfect when value is equal to eight or nine..
Wtf is going on here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
add a
, 10to parseInt:which tells JS to treat is as a base-10 number. By default, anything starting with
0is treated as an octal, base-8 number. Since09isn’t a valid base-8 number, you’ll get0