[resolved] jQuery Datepicker not working in WP 3.5b3 (5 posts)

  1. revaxarts
    Posted 3 years 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();

  2. daveshine (David Decker)
    Posted 3 years ago #

    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...

  3. revaxarts
    Posted 3 years ago #

    But it's still in the global $wp_scripts and loaded with load-scripts.php

    Maybe cause of jQuery UI 1.9.1

  4. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    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.

  5. revaxarts
    Posted 3 years ago #

    Seems RC1 solved that problem :)

    Topic can be closed

Topic Closed

This topic has been closed to new replies.

About this Topic