Does someone know a clean way to set different versions of jQuery, depending on browser, with an integrated use of Yii? In my case, I want to load jQuery 2 to all browsers except to IE 8-.
I'm using, in config/main.php, this clientScript
:
'clientScript'=>array(
'packages'=>array(
'jquery'=>array(
'baseUrl'=>'//ajax.googleapis.com/ajax/libs/jquery/2.0.3/',
'js'=>array('jquery.min.js'),
),
)
),
Yii 1.1.14 carries jQuery 1.8.3, and it would get referenced into the page when calling registerCoreScript()
:
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery.ui');
, because jQuery is registered as a dependence of jQueryUI. But it doesn't, because of my clientScript
, defined as above. Hence, all browsers get jQuery 2 and the problem is that it doesn't offer support to IE 8-.
There is also the option of using IE comments, just like:
<!--[if (gte IE 6)&(lte IE 8)]>
So, here is the question: I would like to avoid the solution with comments and let the Yii do the job for me, but how?