Thursday, 12 September 2013

JavaScript parseInt function fails in IE8 for string "08" and "09"

We have used the java script function parseInt to parse the strings, however on the 9 th sept it started failing, I debugged the script and observed the following things :

var dt = parseInt("09");  // gives result as 0
var dt = parseInt("08");   // gives result as 0
var dt = parseInt("07");  // gives result as 7

solution is specify base 10

var dt = parseInt("09", 10);  // gives result as 9
var dt = parseInt("08", 10);   // gives result as 8
var dt = parseInt("07", 10 );  // gives result as 7

Reason : Both parseInt('08') and parseInt('09') return zero because the function tries to determine the correct base for the numerical system used. In Javascript numbers starting with zero are considered octal and there's no 08 or 09 in octal, hence the problem.

Migration issues for SAP.Connector.dll from Win 2003 to Win 2019 server

Recently I got task of migration of asmx web services from windows 2003 to windows 2019 server. These web services fetch data from SAP us...