Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI 1.7.3 datepicker conflict with date.js causing "too much recursion"?

I'm trying to use jQuery UI 1.7.3 datepicker widget in a jQuery UI dialog. The contents of the dialog are from a page template which includes all the various imports of javascript required to make the page function. One of the things I also import is the famous date.js file.

This page that I load in the dialog also exists by itself as a standalone page. The datepicker works like a charm there. Everything breaks when I load it in the dialog. When focus is given to the date input field, the datepicker should show up. However, I get a disgusting error like so:

too much recursion
[Break on this error] return w;};Date.prototype.isDST=function...ase"z":return"";}}):this._toString();};\n

The datepicker calendar doesn't show and I get 1 error in my firebug saying that it's date.js that is puking. I've ran into similar problems like this in the past dealing with too much recursion but I am never too sure how to fix such errors.

Can someone tell me what's the matter?

like image 595
Mark Avatar asked Nov 11 '10 06:11

Mark


2 Answers

I'm running jQuery UI 1.7.3 and date.js as well for a modal window and was having the same problem. I was sending all of the scripts needed for the standalone page and for the dialog all in one go, but this meant that some of the same scripts were actually duplicated from the main application window to the dialog. Removing references to the duplicated scripts (for the dialog) fixed the problem.

In essence, Date.js was being loaded twice, and fixing that fixed the problem.

like image 192
Joshua Smith Avatar answered Oct 06 '22 02:10

Joshua Smith


I'm successfully using the datepicker in a modal jqueryui dialog, version 1.8.9. But I'm including the .js as a 'all-in-one'.

You should try to update jqueryui or use the complete package as one file for testing, and if it does not work, provide a failing test case so we can look at it.

like image 23
Markus Avatar answered Oct 06 '22 01:10

Markus