CClientScript should not include JQuery library on ajax requests

Hi

I am not sure if this is something Yii should do automatically or not,

Currently if you call

Yii::app()->clientScript->registerScript("sayHello","alert('hello')");

The jquery core is included in the returned response - even if the request is an ajax request - this could cause issues with extensions that have registered themselves with jquery because the "new" jquery will replace the older one. Of course if the call is made properly like

Yii::app()->clientScript->registerScript("sayHello","alert('hello')", CClientScript::POS_END);

then this is not really an issue.

nz

This remains as an open problem. Currently, you can use the following as a workaround:

Nice !

Thx

nz

what is the work around?

in the controller use

$this->renderPartial(‘path-to-view-file’, array(), false, true);

then in the view you can do

Yii::app()->clientscript->scriptMap[‘jquery.js’]=false; // do not include jquery

works for me so far.