Ramblings of a volatile mind

"Doesn't anything solidify in your mind?" ..."No, not really..."

The mind is a complicated thing, and lots of stuff lurk in it. What will you find in mine? A lot of mush, for sure. There are also other things though. Stuff about God, the Bible, Internet technology, Web Scripting, Programming, Music, Piano etc. An eclectic mix. My mind's scratchpad. My life. Wanna have a look?

Thursday, May 19, 2005

Web Scripting: javascript parseInt() quirk in IE6

try running this javascript in IE6:

<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:

Blogger ken said...

nope works the same on my firefox. zeroes zeroes. quirks mode strikes again!

8:27 AM  
Blogger Jase said...

oooh so i'm not the only one with this problem...

4:07 PM  

Post a Comment

<< Home