To have a working datepicker on a field, I have to put this script inside my element
$( function() {
$( "#date_datepicker" ).datepicker( { dateFormat: "yy-mm-dd" } );
});
Removing the $( function() {
makes the datepicker not work.
So does it mean that the $( function() {
is the same as $(document).ready
?
I'm trying to optimize my javascript codes so knowing this might help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…