A few days ago I was writing a tutorial on RSS readers and Social bookmarking, in that tutorial I needed to take snap shots of several websites and I needed a tool to do this quickly and easily.
I Googled and Googled until I found this Firefox addon
it adds a small button to your toolbar which allows you to take a snapshot of the whole website length or just the visible portion, It helped me alot, I highly recommend it.
I used parseInt() earlier to extract the number from a string coming for an input field, the numbers always had a leading zero, like “09 , 08, 07″ , When I sent these apparently “normal” and “easy-to-convert” values , parseInt() always returned 0! .
I had no doubts about parseInt() I thought it was my code that’s causing this problem, I double checked everything and I finally turned to parseInt() ,Everything seemed to work very well “Before” parseInt() enters.
If the radix parameter is omitted, JavaScript assumes the following:
* If the string begins with “0x”, the radix is 16 (hexadecimal)
* If the string begins with “0″, the radix is 8 (octal). This feature is deprecated
* If the string begins with any other value, the radix is 10 (decimal)
so if the string begins with “0″ , the radix is automatically assumed to be 8 (octal) but it seems that this feature is still Not deprecated on FF 2.0.0.4 (not sure about IE) .
To fix this I had to force parseInt() to use Decimal numeral system by explicitly specifying the radix (10).
Example:
Update June 9th 2007: I’ve came to discover that this issue is very well known and well documented all over the web , The funny thing is that Microsoft’s Solution is based on “manual” approach “that is using a loop that removes every leading ‘0′ by string functions!”, although specifying the radix explicitly would solve the whole situation.