Pass codeigniter translation array to jQuery Function

Posted by grolle on Stack Overflow See other posts from Stack Overflow or by grolle
Published on 2010-05-27T08:19:33Z Indexed on 2010/05/27 8:21 UTC
Read the original article Hit count: 182

Filed under:
|

Hi,

I’ve a problem by passing an array to a jQuery function. Some code:

// in the language file

$lang['daynames'] = array('So','Mo','Di','Mi','Do','Fr','Sa');

//In the view

var config = { basePath : '' }; // THIS WORKS GREAT!!! var days = new array('lang->line('daynames')); ?>');
//in the js-File
    $(function() {
            $("#datepicker").datepicker({
                dateFormat  : 'dd.mm.yy',
                showWeek    : true,
                firstDay    : 1,
                weekHeader  : 'KW',
                dayNamesMin : days,
                monthNames  : ['Januar','Februar','März','April',
                               'Mai','Juni','Juli','August','September',
                               'Oktober','November','Dezember'],
                onSelect    : function(dateText,inst){
                              }
            });
}); 

If I do lang->line(‘daynames’)); ?> in the view everything looks fine, so what is wrong here?

Thanks and best regards ...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about codeigniter