revaxarts
Member
Posted 7 months ago #
I've used wp_enqueue_script('jquery-ui-datepicker'); for the datepicker in one of my plugins which works in WP 3.5b2.
Since beta 3 I get
Uncaught TypeError: Object [object Object] has no method 'datepicker'
Does version 1.9.1 of jQuery UI doesn't allow the use of jQuery([selector]).datepicker();
I've read somewhere that you can't use shorthand version but with full syntax it should work. Just can't find the link to the tutorial anymore...
revaxarts
Member
Posted 7 months ago #
But it's still in the global $wp_scripts and loaded with load-scripts.php
Maybe cause of jQuery UI 1.9.1
I can't reproduce this with jQuery UI 1.9.1 (beta 3 and RC1), jQuery UI 1.9.0 (beta 2), or jQuery UI 1.8.x in WordPress 3.4.
The datepicker file is loaded in the footer. (Same if SCRIPT_DEBUG is off and the file is loaded via load-scripts.php.) If you are calling jQuery([selector]).datepicker() in a plugin before it loads, then you'll see this error. Waiting until document ready (jQuery.ready()) will allow the datepicker script to load first.
revaxarts
Member
Posted 6 months ago #
Seems RC1 solved that problem :)
Topic can be closed