I use a TWebBrowser component in a delphi application and communicate using JavaScript.
In JavaScript I have the following code:
function test() {
var nr = external.GetNumber();
alert(nr);
nr = parseInt(nr); // this is where the javascript fails
doSomethingWith(nr);
}
alert(nr) function shows up the number I was expecting (eg: 1517376) but when I call parseInt (or any other function) it fails with "external.GetNumber(); is not a string". The type of nr is "undefined" .
Is there a way to convert it to string or numeric? I tried nr.toString(), String(nr), nr = nr + '' and they all fail because "String was expected". This only happens on IE6.