i'm using asual jquery-address, tabs example and want to add datepicker to the "Extra" tab. If i'm just adding
$(document).ready(function() {
$( "#datepicker" ).datepicker();
});
it wont work. So i found out i have to use .live(). As im using jquery-1.7 .live() has changed to .on().
If i add this code datepicker only works on the second click.
$(document).ready(function() {
$(document).on('click', '#datepicker', function () {
$(this).datepicker();
});
});
I saw in another thread a not recommended way to make it work like this
$(document).ready(function() {
$(document).on('click', '#datepicker', function () {
$(this).datepicker().datepicker( "show" );
});
});
How am i using it correctly? Is there a recommended way to make datepicker work like i want in this example?
I think i need to use .on() because i want to reload the form that's including #datepicker with a .load() event.