我计划使用谷歌来下载UI和核心的jQuery库。我的问题是,他们是否允许我下载CSS,还是我必须自己托管它?
另外,如果我使用谷歌加载我应该如何加载其他插件?我可以压缩所有的插件在一起,还是应该是它自己的单独文件?
我计划使用谷歌来下载UI和核心的jQuery库。我的问题是,他们是否允许我下载CSS,还是我必须自己托管它?
另外,如果我使用谷歌加载我应该如何加载其他插件?我可以压缩所有的插件在一起,还是应该是它自己的单独文件?
当前回答
jQuery现在有一个CDN访问:
code.jquery.com/ui/[版本]/主题/[主题名称]/jquery-ui.css
为了让这更简单一点,给你:
base: http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css black-tie: http://code.jquery.com/ui/1.9.1/themes/black-tie/jquery-ui.css blitzer: http://code.jquery.com/ui/1.9.1/themes/blitzer/jquery-ui.css cupertino: http://code.jquery.com/ui/1.9.1/themes/cupertino/jquery-ui.css dark-hive: http://code.jquery.com/ui/1.9.1/themes/dark-hive/jquery-ui.css dot-luv: http://code.jquery.com/ui/1.9.1/themes/dot-luv/jquery-ui.css eggplant: http://code.jquery.com/ui/1.9.1/themes/eggplant/jquery-ui.css excite-bike: http://code.jquery.com/ui/1.9.1/themes/excite-bike/jquery-ui.css flick: http://code.jquery.com/ui/1.9.1/themes/flick/jquery-ui.css hot-sneaks: http://code.jquery.com/ui/1.9.1/themes/hot-sneaks/jquery-ui.css humanity: http://code.jquery.com/ui/1.9.1/themes/humanity/jquery-ui.css le-frog: http://code.jquery.com/ui/1.9.1/themes/le-frog/jquery-ui.css mint-choc: http://code.jquery.com/ui/1.9.1/themes/mint-choc/jquery-ui.css overcast: http://code.jquery.com/ui/1.9.1/themes/overcast/jquery-ui.css pepper-grinder: http://code.jquery.com/ui/1.9.1/themes/pepper-grinder/jquery-ui.css redmond: http://code.jquery.com/ui/1.9.1/themes/redmond/jquery-ui.css smoothness: http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css south-street: http://code.jquery.com/ui/1.9.1/themes/south-street/jquery-ui.css start: http://code.jquery.com/ui/1.9.1/themes/start/jquery-ui.css sunny: http://code.jquery.com/ui/1.9.1/themes/sunny/jquery-ui.css swanky-purse: http://code.jquery.com/ui/1.9.1/themes/swanky-purse/jquery-ui.css trontastic: http://code.jquery.com/ui/1.9.1/themes/trontastic/jquery-ui.css ui-darkness: http://code.jquery.com/ui/1.9.1/themes/ui-darkness/jquery-ui.css ui-lightness: http://code.jquery.com/ui/1.9.1/themes/ui-lightness/jquery-ui.css vader: http://code.jquery.com/ui/1.9.1/themes/vader/jquery-ui.css
其他回答
谷歌是托管jQueryUI css在这个链接https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css
如果你直接看这段代码,它正在使用@import导入css,这可能会很慢。您可能希望将导入分解到各个部分中,以获得轻微的性能优势:
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css
谷歌AJAX Libraries API,包括jQuery UI(目前v1.10.3),也包括流行的主题,根据jQuery UI博客:
谷歌Ajax Libraries API (CDN)
Uncompressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.js Compressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js Themes Uncompressed: black-tie, blitzer, cupertino, dark-hive, dot-luv, eggplant, excite-bike, flick, hot-sneaks, humanity, le-frog, mint-choc, overcast,pepper-grinder, redmond, smoothness, south-street, start, sunny, swanky-purse, trontastic, ui-darkness, ui-lightness, and vader. Themes Compressed: black-tie, blitzer, cupertino, dark-hive, dot-luv, eggplant, excite-bike, flick, hot-sneaks, humanity, le-frog, mint-choc, overcast,pepper-grinder, redmond, smoothness, south-street, start, sunny, swanky-purse, trontastic, ui-darkness, ui-lightness, and vader.
如果你指的是jQuery UI css,你可以使用这个:
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
jQuery现在有一个CDN访问:
code.jquery.com/ui/[版本]/主题/[主题名称]/jquery-ui.css
为了让这更简单一点,给你:
base: http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css black-tie: http://code.jquery.com/ui/1.9.1/themes/black-tie/jquery-ui.css blitzer: http://code.jquery.com/ui/1.9.1/themes/blitzer/jquery-ui.css cupertino: http://code.jquery.com/ui/1.9.1/themes/cupertino/jquery-ui.css dark-hive: http://code.jquery.com/ui/1.9.1/themes/dark-hive/jquery-ui.css dot-luv: http://code.jquery.com/ui/1.9.1/themes/dot-luv/jquery-ui.css eggplant: http://code.jquery.com/ui/1.9.1/themes/eggplant/jquery-ui.css excite-bike: http://code.jquery.com/ui/1.9.1/themes/excite-bike/jquery-ui.css flick: http://code.jquery.com/ui/1.9.1/themes/flick/jquery-ui.css hot-sneaks: http://code.jquery.com/ui/1.9.1/themes/hot-sneaks/jquery-ui.css humanity: http://code.jquery.com/ui/1.9.1/themes/humanity/jquery-ui.css le-frog: http://code.jquery.com/ui/1.9.1/themes/le-frog/jquery-ui.css mint-choc: http://code.jquery.com/ui/1.9.1/themes/mint-choc/jquery-ui.css overcast: http://code.jquery.com/ui/1.9.1/themes/overcast/jquery-ui.css pepper-grinder: http://code.jquery.com/ui/1.9.1/themes/pepper-grinder/jquery-ui.css redmond: http://code.jquery.com/ui/1.9.1/themes/redmond/jquery-ui.css smoothness: http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css south-street: http://code.jquery.com/ui/1.9.1/themes/south-street/jquery-ui.css start: http://code.jquery.com/ui/1.9.1/themes/start/jquery-ui.css sunny: http://code.jquery.com/ui/1.9.1/themes/sunny/jquery-ui.css swanky-purse: http://code.jquery.com/ui/1.9.1/themes/swanky-purse/jquery-ui.css trontastic: http://code.jquery.com/ui/1.9.1/themes/trontastic/jquery-ui.css ui-darkness: http://code.jquery.com/ui/1.9.1/themes/ui-darkness/jquery-ui.css ui-lightness: http://code.jquery.com/ui/1.9.1/themes/ui-lightness/jquery-ui.css vader: http://code.jquery.com/ui/1.9.1/themes/vader/jquery-ui.css
我想是的。为什么不呢?如果不提供CSS来支持脚本文件,就不是一个CDN
这种联系表明它们是:
我们发现特别令人兴奋的是 jQuery UI CSS主题现在 托管在谷歌的Ajax Libraries CDN上。