开发者

YUILoader comboBase setting for Google CDN

开发者 https://www.devze.com 2023-01-20 05:36 出处:网络
I\'d like to use Google\'s hosted version of YUI (since Yahoo\'s doesn\'t support SSL). I\'m using YUILoader:

I'd like to use Google's hosted version of YUI (since Yahoo's doesn't support SSL). I'm using YUILoader:

var loader = new YAHOO.util.YUILoader({
    require: ["autocomplete"],
    onSuccess: function() { ac_ready = true; setup_manager_autocomp() },
    combine: true
});

I'm loading yuiloader from Google's CDN:

<script src="https://ajax.googleapis.com/ajax/libs/yui/2.8.开发者_如何学Python1/build/yuiloader/yuiloader-min.js"></script>

But the request YUILoader makes goes to Yahoo instead of googleapis.com . Apparently I need to set "base" and "comboBase", ala:

comboBase: 'http://yui.yahooapis.com/combo?',

except set to googleapis instead of yahooapis.

I can't quite figure out what comboBase should be when using googleapis. Anybody know the magic incantation?


Parand,

Google's CDN does not support combo-handling (Yahoo's CDN does support this feature). As a result, when loading from Gooogle's CDN you need to set combine:false.

The Dependency Configurator for YUI 2 can help here:

http://developer.yahoo.com/yui/articles/hosting/?autocomplete&MIN&nocombine&basepath&http://ajax.googleapis.com/ajax/libs/yui/2.8.1/build/&google

Click on the "Dynamic Loading with YUI Loader" tab for sample code.

-Eric

0

精彩评论

暂无评论...
验证码 换一张
取 消