Skip to main content

Bug Tracker

Side navigation

#2592 closed bug (fixed)

Opened March 27, 2008 10:11AM UTC

Closed March 27, 2008 02:29PM UTC

Last modified April 07, 2008 10:55AM UTC

jquery.datepicker undefined

Reported by: atlithorn Owned by: paul
Priority: major Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: datepicker Cc:
Blocked by: Blocking:
Description

Using datepicker version 3.4. In IE the jquery.datepicker object is undefined in the onload handler for a page we were building. What worked for us was to simply move the singleton instantiation

$.datepicker = new Datepicker()

out of the $(document).ready handler.

So the code now looks like this:

/* Initialise the date picker. */
$.datepicker = new Datepicker(); // singleton instance

$(document).ready(function() {

	$(document.body).append($.datepicker._datepickerDiv).
		mousedown($.datepicker._checkExternalClick);
});

This works perfectly for us.

Attachments (0)
Change History (2)

Changed March 27, 2008 02:29PM UTC by scott.gonzal comment:1

resolution: → fixed
status: newclosed

Already fixed in SVN.

Changed April 07, 2008 10:55AM UTC by kae comment:2

I just fixed a copy of datepicker with probably the same problem.

In my case, I moved the "$.datepicker = new Datepicker();" line to before the "$(document).ready()" line above it.

in my case, the problem was that I was loading the ui.datepicker.js file dynamically, so document.ready() was run before datepicker was added to jQuery.

I believe this is the same problem noted here.

version 3.4.3