22.5 LiveConnect Data Conversion
Notice the following points about the data conversions illustrated in Figure 22-2:
Also notice these points about the conversions illustrated in Figure 22-3:
22.5.1 Wrapper Objects
22.5.2 LiveConnect Data Conversion in Netscape 3
var r = new java.awt.Rectangle(0,0,5,5); var w = r.width; // This is a Number object, not a primitive number. var new_w = w + 1; // Oops! new_w is now "51", not 6, as expected.
var r = new java.awt.Rectangle(0,0,5,5); var w = r.width.valueOf( ); // Now we've got a primitive number. var new_w = w + 1; // This time, new_w is 6, as desired.