从 Google 的 CDN 下载 jQuery UI CSS
我计划使用 Google 下载 UI 和 Core 的 jQuery 库。 我的问题是,他们允许我下载 CSS 还是我必须自己托管它?
另外如果我使用Google加载我应该如何加载其他插件? 我可以将所有插件压缩在一起还是应该将其作为自己的单独文件?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Google AJAX 库 API 包括 jQuery UI(当前为 v1.10.3),还包括流行的主题,如 jQuery UI 博客:
Google Ajax 库 API (CDN)
未压缩:http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.js
压缩:http://ajax. googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js
主题未压缩:
黑领带 , 闪电战, 库比蒂诺,dark-hive,dot-luv,茄子,excite-bike,轻拂,hot-sneaks,人性, le-frog,mint-choc,阴天,胡椒研磨机,雷蒙德,平滑度,南街,开始,阳光明媚,swanky-purse,trontastic,ui-darkness,ui-lightness 和 vader。
主题压缩:
黑领带、闪电战, 库比蒂诺 , 暗蜂巢< /a>, 点-luv,茄子,excite-bike,轻拂,热门预告,人性,le-frog,薄荷巧克力,阴,胡椒研磨机,雷蒙德,平滑度,南街,开始,阳光明媚,时髦钱包,trontastic,ui 黑暗度,ui-lightness 和 vader.
The Google AJAX Libraries API, which includes jQuery UI (currently v1.10.3), also includes popular themes as per the jQuery UI blog:
Google 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 现在具有 CDN 访问权限:
code.jquery.com/ui/[版本]/themes/[主题名称]/jquery-ui.css
并使其成为更简单一点,在这里:
jQuery now has a CDN access:
code.jquery.com/ui/[version]/themes/[theme name]/jquery-ui.css
And to make this a little more easy, Here you go:
Google 在此链接托管 jQueryUI css https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css
如果直接看这段代码,它是使用@import导入css < a href="https://stackoverflow.com/a/1022715/745">这可能会很慢。 您可能希望将导入纳入其各个部分以获得轻微的性能优势:
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
Google is hosting jQueryUI css at this link https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css
If you look at this code directly, it is importing the css using @import which can be slow. You may want to factor the import into its parts to gain a slight performance benefit:
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
正如奥巴马所说“是的,我们可以”。 这是它的链接。 developers.google.com/#jquery
您需要使用
Google< /strong>
jQuery CDN
Microsoft
在此处查找主题名称 http:// jqueryui.com/themeroller/ 在画廊子选项卡中
。
但我不建议您从 CDN 托管,原因如下。
http://zoompf.com/blog/2010/01 /你应该使用-javascript-library-cdns
As Obama says "Yes We Can". Here is the link to it. developers.google.com/#jquery
You need to use
Google
jQuery CDN
Microsoft
Find theme names here http://jqueryui.com/themeroller/ in gallery subtab
.
But i would not recommend you hosting from cdn for the following reasons
http://zoompf.com/blog/2010/01/should-you-use-javascript-library-cdns
我也这么认为。 为什么不? 如果不提供 CSS 来支持脚本文件,CDN 就不算什么
此链接 表明它们是:
I would think so. Why not? Wouldn't be much of a CDN w/o offering the CSS to support the script files
This link suggests that they are:
如果您指的是 jQuery UI css,则可以使用这个:
You could use this one if you mean the jQuery UI css:
jQuery UI < 1.13 现在被 Google Page Speed Insights 视为安全漏洞。
请改用安全修复的更新版本。 截至 2022 年,这将是 1.13.2
例如:
https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js
https:// /ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.min.css
完整的 HTML 标签示例:
jQuery UI < 1.13 is considered a security vulnerability now by Google Page Speed Insights.
Use a security-fixed more current version instead. As of 2022 this would be 1.13.2
Ex:
https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.min.css
Full HTML Tag Examples: