I am receiving the error:
Uncaught TypeError: undefined is not a function
When I try to set up the datepicker:
$('.datepicker').datepicker();
How can I determine if the datepicker has loaded or not?
To be clear, I'm not using jQuery UI
I am receiving the error:
Uncaught TypeError: undefined is not a function
When I try to set up the datepicker:
$('.datepicker').datepicker();
How can I determine if the datepicker has loaded or not?
To be clear, I'm not using jQuery UI
This stopped me loading bootstrap-datepicker more than once throughout modals..
You can check to see if the datepicker script has loaded using:
Then you can conditionally invoke the
.datepicker()
method if the script has loaded:Example Here
In doing so, the error won't be thrown if the script hasn't loaded.
You can also use:
Example Here