Web Scripting: javascript parseInt() quirk in IE6
try running this javascript in IE6:
(or click here to run it...)
what you're supposed to see are 9 separate alerts showing the number from 1 to 9. not sure about you guys out there, but for my browser, 8 and 9 both show up as 0. does that happen to anyone else?
<script language = "javascript">
for (i = 1; i < 10; i++) {
n = "0"+i;
alert(parseInt(n));
}
</script>
(or click here to run it...)
what you're supposed to see are 9 separate alerts showing the number from 1 to 9. not sure about you guys out there, but for my browser, 8 and 9 both show up as 0. does that happen to anyone else?
2 Comments:
nope works the same on my firefox. zeroes zeroes. quirks mode strikes again!
oooh so i'm not the only one with this problem...
Post a Comment
<< Home