|
Differences between jQuery 1.2.x and 1.3.x - html() function not taking a number |
|
Facts -
HTML and Javascript
|
|
Tuesday, 31 March 2009 13:32 |
|
Page 2 of 4
html() function not taking a number
If a function foo() returns a number than you can not use the result in the html() function. Before the following worked:
foo() { return new Number(123); }
$('#displayFooResult').html(foo());
With jQuery 1.3.x I have to use the following:
foo() { return new Number(123); }
$('#displayFooResult').html("<span>" +foo() +"</span>");
|