This is discussed in forum:
http://forums.java.net/jive/thread.jspa?messageID=301756
In JavaScript, when passing a "Number" value to a Java method that is expecting a String value and returns a String (i.e. String foo(String arg)). The behavior is different. In 6u7, if Number value = 3, the returned String from Java method is "3", but in 6u10, the return value is "3.0". This is only reproducible with IE.
jscript version is 5.7.0.16535
If I set the value of a variable as:
x=Number(3);
then it is converted correctly as a java String to "3" in 1.6.0_10.
But if set the value of a variable (with quotes around the 3) as:
x=Number("3");
then it is converted incorrectly as a java String to "3.0" in 1.6.0_10.
Both result in "typeof x" to return "number" but the objects are obviously slightly different otherwise java would convert them to the same value.
http://forums.java.net/jive/thread.jspa?messageID=301756
In JavaScript, when passing a "Number" value to a Java method that is expecting a String value and returns a String (i.e. String foo(String arg)). The behavior is different. In 6u7, if Number value = 3, the returned String from Java method is "3", but in 6u10, the return value is "3.0". This is only reproducible with IE.
jscript version is 5.7.0.16535
If I set the value of a variable as:
x=Number(3);
then it is converted correctly as a java String to "3" in 1.6.0_10.
But if set the value of a variable (with quotes around the 3) as:
x=Number("3");
then it is converted incorrectly as a java String to "3.0" in 1.6.0_10.
Both result in "typeof x" to return "number" but the objects are obviously slightly different otherwise java would convert them to the same value.
- duplicates
-
JDK-6564860 Liveconnect: Data types issues on IE should be documented or FIXED
- Closed
- relates to
-
JDK-6741935 A number passed from JavaScript to Applet become an invalid number format
- Closed