How to disable jQuery autoloading on Ajax request in Yii?

前端 未结 3 1518
野趣味
野趣味 2020-12-14 23:50

I\'m using the following code to generate an ajax request:

echo CHtml::dropDownList(\'teamA\', \'\', EnumController::getTeamOption(), array(
        \'empty\         


        
3条回答
  •  臣服心动
    2020-12-15 00:12

    Following the instructions from Yii Special Topics Performance, I made a quick test, and this worked:

    At the top of the main layout:

    clientScript;
    $cs->scriptMap=array(
        'jquery.js'=>false,
        'jquery.ui.js' => false,
    );?>
    

    In the section of the main layout:

    
    
    

    or

    
    
    
    

    I would actually use the CGoogleApi helper, but the jsapi apparently cannot load jquery versions higher than those in my example! I guess that's slow updating on Google's part, because it doesn't work in a plain file either.

    Or maybe the js file was still in your cache?

提交回复
热议问题