Oh, I see that! That's not good. Working on it ...
Dani
The Queen of DaniWeb
21,343 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 367
Skill Endorsements: 119
Fixed ... super sorry about that.
Dani
The Queen of DaniWeb
21,343 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 367
Skill Endorsements: 119
Moral of the story: Don't trust parseInt() to work the same in Firefox as it does in Chrome.
Dani
The Queen of DaniWeb
21,343 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 367
Skill Endorsements: 119
aah, the wonders of web-programming. How I totally do not miss that :)
Nick Evan
Cold-a$$ donkey
10,261 posts since Oct 2006
Reputation Points: 4,155
Solved Threads: 416
Skill Endorsements: 22
Moral of the story: Don't trust parseInt() to work the same in Firefox as it does in Chrome.
I'm really interested now, details please. And while we are at it, were you passing in the second argument to parseInt? If not, bad Dani. :)
~s.o.s~
Failure as a human
12,220 posts since Jun 2006
Reputation Points: 3,307
Solved Threads: 783
Skill Endorsements: 54
The documentation told me that base 10 was assumed if you didn't pass in the second argument!!
It worked in Chrome, Safari and Internet Explorer!!
Dani
The Queen of DaniWeb
21,343 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 367
Skill Endorsements: 119
The documentation told me that base 10 was assumed if you didn't pass in the second argument!!
Oh noes, there is no such thing specified in the specification. The MDN goes to great lengths to even mention this:
An integer that represents the radix of the above mentioned string. Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified.
:)
EDIT: If you plan on always dealing with base 10 numbers, using the Number constructor is a safer option.
~s.o.s~
Failure as a human
12,220 posts since Jun 2006
Reputation Points: 3,307
Solved Threads: 783
Skill Endorsements: 54
But the input string didn't start with 0x or 0. At least, I think not ;)
Dani
The Queen of DaniWeb
21,343 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 367
Skill Endorsements: 119
Question Answered as of 2 Months Ago by
Dani,
~s.o.s~
and
Nick Evan