Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery issue with Chrome

I have a page that uses JQuery for an ajax call. Viewing the page in Chrome shows the following error in the developer console:

 Uncaught TypeError: Cannot set property 'display' of undefined

While the same page runs in firefox 3.6.6 without any error in the firebug console.

The error emanates from a line in j-query-1.4.2 ( as shown in the chrome console)

Anyone else facing similar issues ?

Basically, I am using a DatePicker which shows up within a Modal Dailog.

Here is the code :

$(document).ready(function () {
$("#inputs input[name=dateField]").datepicker(
        {
            showOn: 'both',
            dateFormat:'dd/mm/yy HH:II TT',
            showButtonPanel: true, 
            maxDate: '+0D',
            buttonImage:'calendar.gif',
            buttonImageOnly: true,
        }
);
 });
like image 952
Arun R Avatar asked Nov 14 '22 09:11

Arun R


1 Answers

I suggest you start trying your lines of code out in chrome's developer console. Open up the Developer Tools while on your page (so all of your code is loaded) and go to the console tab. Type/Paste into the console:

$("#inputs input[name=dateField]")

And see if that returns an object with a length. If the object returned only has "context", "selector" and "__ proto__" properties, jquery found nothing. If it also has a "length" property, and properties that are named numbers ("0", "1", etc), then it found something (or multiple somethings).

From there, you can try other code to see what Chrome will say.

like image 58
Tustin2121 Avatar answered Dec 18 '22 04:12

Tustin2121