I had problem in my app that made it slow , after checked firebug
I noted that jquery-ui loaded twice first from google.com and second from assets folder ("232kb") .
How to force it to load from google.com without assets version ?
View content " JavaScript to call Ajax function ":
....
$(".third,#second-next,#fourth-pr").click(function () {
$.ajax({
url: '<?php echo Yii::app()->createUrl('site/CallScientificForm',array('language'=>language())); ?>',
type: 'GET',
dataType: 'html',
beforeSend: function () {
$("#loading").show();
},
success: function (data, textStatus, xhr) {
$("#hr3").css("background", "#51a351");
$("*").removeClass("active");
$(".third").addClass("active");
$("#firstContent ,#secondContent,#thirdContent,#fourthContent").fadeOut(2000);
$("#thirdContent").html(data);
$("#thirdContent").fadeIn(2000);
$("#loading").hide();
},
error: function (xhr, textStatus, errorThrown) {
$('#' + id + ' .contentarea').html(textStatus);
},
complete: function() {
$(this).data('requestRunning', false);
}
});
});
...
Controller:
...
public function actionCallScientificForm()
{
$scienceModel = new MembershipScientific();
$view= $this->renderPartial('_ScientificForm', array('scienceModel' => $scienceModel, 'language' => language()), false, true);
echo $view;
Yii::app()->end();
}
..
Main config:
'clientScript'=>array(
'packages'=>array(
'jquery'=>array(
'baseUrl'=>'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/',
'js'=>array('jquery.js'),
'coreScriptPosition'=>CClientScript::POS_END
),
'jqueryMin'=>array(
'baseUrl'=>'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/',
'js'=>array('jquery.min.js'),
'coreScriptPosition'=>CClientScript::POS_END
),
'jquery-ui'=>array(
'baseUrl'=>'https://code.jquery.com/ui/1.11.1/jquery-ui.min.js',
'js'=>array('jquery-ui.min.js'),
'depends'=>array('jquery'),
'coreScriptPosition'=>CClientScript::POS_END
)
),
),
And I called it in target view like this :
....
cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery-ui');
....
Thanks in advance