I am working with a language file that stores the traductions for the jquery datepicker
URL: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/i18n/jquery-ui-i18n.min.js?ver=3.4.2
The jQuery.datepicker.regional object is returned and I would like to access the it (italian) property of this object.
My problem is that when I do something like
console.log(jQuery.datepicker.regional['it'])
or
console.log(jQuery.datepicker.regional.it)
the console says the object is undefined.
But when I do something like:
console.log(jQuery.datepicker.regional);
The console returns something like this:
[Object]
: Object
af: Object
ar: Object
...
it: Object
What am I doing wrong? The “it” object is there isn’t it?
How can I access the “it” object of the jQuery.datepicker.regional object?
Thanks
jQuery.datepicker.regionalis updated with each translation object when the DOM is ready:Try accessing it similarly:
Aside regarding
console.logconsole.logging just the regional object shows all the localization objects becauseconsole.log(and sometimesconsole.dir) prints a reference to the object, whose properties may have changed by the time you actually look at them in the console. There are definitely some browser idiosyncrasies.For example, in Chrome 25.0.1337.0:
While in Firefox 17.0 + Firebug 1.9.2: