jquery from CDN (e.g. google jsapi)

What is the most elegant way to use jquery from CDN instead from my server? If I simply map jquery in cscript to false and put url to jsapi in <HEAD>, yii adds AFTER this all the scripts and css’es from registerScript. This results in

jquery.js from google

some.css

some2.css

some.js

some.js2

this is not the perefect order --> because loading of jquery.js in this place will block all css from parallel loading.

regards

Augustin

It’s described in the guide:

http://www.yiiframework.com/doc/guide/1.1/en/topics.performance

Have you considered the order of importing from <HEAD> section?

Optimal is:

import all css (they don’t block and can be downloaded in parallel)

import "core" js (e.g. jquery, jqueryui) (other scripts depends on them)

import all other scripts neccessary before rendering

With your way, you don’t get this order.

btw. on google jsapi you’ll find only jquery from all what you have listed in your way

regards,

augustin

It’s better to check it. If the order is wrong, please create a ticket and we’ll try to fix it: http://code.google.com/p/yii/issues/list