Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2592 closed bug (fixed)

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.

Change History (2)

comment:1 Changed 12 years ago by scott.gonzal

Resolution: fixed
Status: newclosed

Already fixed in SVN.

comment:2 Changed 12 years ago by kae

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

Note: See TracTickets for help on using tickets.