|
Migrating jQuery javascript code from 1.2.x to 1.3.x should be an easy task. Unfortunatly I encountered a few problems. These are accessing jQuery UI tabs, and the use of the html() function. Especially the latter problem took a lot of time to solve.
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>");
jQuery UI
jQuery 1.2.x is compatible with jQuery UI 1.6.y. jQuery 1.3.p is compatible with jQuery 1.7.q. So if you upgrade jQuery from 1.2 to 1.3 you also have to upgrade jQuery UI from 1.6 to 1.7.
Accessing jQuery UI Tabs
In this example tabsContainer is the DOM Id of the DIV surrounding the list defining the tabs and the DIV's with the contents of the individual tabs. With jQuery 1.2.x and jQuery 1.6 UI I used the following syntax:
$(document).ready(function() {
$("#tabsContainer > ul").tabs();
});
With jQuery 1.3 and jQuery UI 1.7 I have changed this to:
$(document).ready(function() {
$("#tabsContainer").tabs();
});
|