In my development I put all the ajax code inside my CHtml tags. I have given example below , Like this I have lot of Java script, Jquery and ajax calls in the code . I don't find a way to separate them now .. . Do we have to separate that code to separate java script files to speed up the application ? I read it in our forums somewhere there is a way to separate them .. Could you please throw some light on this? Thanks for your help
<?php echo CHtml::dropDownList('nat_type',$per_type,$per_types,
array(
'ajax' => array(
'type' => 'POST',
'beforeSend' => 'function(){$("#myDiv").addClass("loading");}',
'complete' => 'function(){$("#myDiv").removeClass("loading");}',
'dataType'=>'json',
'url' => CController::createUrl('myMasterTypes/types'),
'success'=>'function(data) {
$("#car").html(data.dropDownA);
$("#car").prepend(\'<option value="" selected> - Select Car - </option>\');
refreshList(1);
}',
'error'=>'function (xhr, ajaxOptions, thrownError){
alert(xhr.responseText);
} ',
),));?>

Help














