yii assets jquery ui-1.7.2 issue

I have a problem with jquery assets issue

I have installed jquery-ui-1.7.2.js

and added in main.php below script like as

Yii::app()->clientScript->registerCoreScript(‘jquery’);

echo CHtml::scriptFile(Yii::app()->request->baseUrl . ‘/js/jqueryUI/jquery-ui-1.7.2.js’);

echo CHtml::scriptFile(Yii::app()->request->baseUrl . ‘/js/jqueryUI/i18n/ui.datepicker-’ . Yii::app()->domain->lang . ‘.js’);

echo CHtml::scriptFile(Yii::app()->request->baseUrl . ‘/js/validate/localization/messages_’ . Yii::app()->domain->lang . ‘.js’);

this creates error

1 ->>>> it append some illigal character on top of the jquery-ui-1.7.2.js like ���…

2 ->>>> $.datepicker is undefined

and for language support have added

jQuery(function($){

$.datepicker.regional[‘fr’] = {

closeText: ‘Fermer’,

prevText: ‘<Préc’,

nextText: ‘Suiv>’,

currentText: ‘Courant’,

monthNames: [‘Janvier’,‘Février’,‘Mars’,‘Avril’,‘Mai’,‘Juin’,

‘Juillet’,‘Août’,‘Septembre’,‘Octobre’,‘Novembre’,‘Décembre’],

monthNamesShort: [‘Jan’,‘Fév’,‘Mar’,‘Avr’,‘Mai’,‘Jun’,

‘Jul’,‘Aoû’,‘Sep’,‘Oct’,‘Nov’,‘Déc’],

dayNames: [‘Dimanche’,‘Lundi’,‘Mardi’,‘Mercredi’,‘Jeudi’,‘Vendredi’,‘Samedi’],

dayNamesShort: [‘Dim’,‘Lun’,‘Mar’,‘Mer’,‘Jeu’,‘Ven’,‘Sam’],

dayNamesMin: [‘Di’,‘Lu’,‘Ma’,‘Me’,‘Je’,‘Ve’,‘Sa’],

dateFormat: ‘dd/mm/yy’, firstDay: 1,

isRTL: false};

$.datepicker.setDefaults($.datepicker.regional[‘fr’]);

});

and also in page source jquery is not minified

<script type="text/javascript" src="/assets/c9ce4981/jquery.js"></script>

how we can set like

<script type="text/javascript" src="/assets/c9ce4981/jquery.min.js"></script>

if i remove

Yii::app()->clientScript->registerCoreScript(‘jquery’);

it works fine.

i have searched lot but didnt get why it is so.

With regards the illegal characters, I’m not sure what this is but make sure you save the file as UTF8 without BOM in your encoding.

To get the minified version of JQuery, just set DEBUG to false or remove the lines as directed in your entry script /siteroot/index.php


// change the following paths if necessary

$yii=dirname(__FILE__).'/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';


// remove the following lines when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

// specify how many levels of call stack should be shown in each log message

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);


require_once($yii);

Yii::createWebApplication($config)->run();

thanks you so much its working now !!! :)