YUI 无法识别
我的这个页面有一个关于 YUI JavaScript 库无法被识别的 JS 错误:
http ://www.comehike.com/outdoors/hike_widget.php?hike_id=164
但这对我来说似乎很奇怪,因为如果你查看源代码,你会看到声明使用 YUI 的行。知道为什么会发生这种情况以及如何解决它吗?
谢谢!!
I have this page that has a JS error about the YUI JavaScript library not being recognized:
http://www.comehike.com/outdoors/hike_widget.php?hike_id=164
But that seems strange to me because if you view source, you will see the line declaring the use of YUI. Any idea why this might be happening and how I can fix it?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您还必须包含 javascript YUI。不仅是 css
你的route.js 需要YUI 3 尝试添加这个:
或者只是:
You must include the javascript YUI too. Not only the css
You will need YUI 3 for your route.js try add this :
or just:
我唯一看到的是:
http://yui.yahooapis.com/combo?2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css&2.8.2r1/build/base/base-min。 css
这是一个 CSS 文件。
编辑:
您包含哪些 YUI Javascript 文件取决于您需要什么功能。它是一个相当广泛的 API,并且有几个版本。
有关 API 的文档,请参阅:http://developer.yahoo.com/yui/。
根据 alexl 的回答,以下是最新版本(3.3.0)的核心功能:
http://yui.yahooapis.com/3.3.0/build /yui/yui-min.js
如果您希望能够阅读 JavasScript,请参阅:
http://yui.yahooapis.com/3.3.0/build/yui /yui.js
The only thing I see is this:
http://yui.yahooapis.com/combo?2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css&2.8.2r1/build/base/base-min.css
Which is a CSS file.
EDIT:
Which YUI Javascript files you include depends on what functionality you need. It is a pretty extensive API, and there are a couple of versions.
For documentation on the APIs, see: http://developer.yahoo.com/yui/.
As per answer by alexl, here are the core functions of the most recent version (3.3.0):
http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js
If you want to be able to read the JavasScript, see:
http://yui.yahooapis.com/3.3.0/build/yui/yui.js
您现在包含的 YUI 文件 (
http://yui.yahooapis.com/combo?2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css&2.8.2r1/build/ base/base-min.css
)仅返回 CSS(样式表)——它用于重置 CSS 属性以在浏览器之间保持一致。它不是您稍后在代码中尝试使用的 YUI JavaScript 库。通过如下方式下载并添加对
yahoo-dom-event.js
的引用:您可以还需要包含其他 YUI .js 文件,具体取决于您正在做什么。 YUI可以模块化。请参阅 http://developer.yahoo.com/yui/2/ 了解具体详细信息,如果您需要这样做。
The YUI file you are including right now (
http://yui.yahooapis.com/combo?2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css&2.8.2r1/build/base/base-min.css
) returns a CSS (stylesheet) only--it is for resetting CSS properties to be consistent across browsers. It is not the YUI JavaScript library which you are trying to use later in the code.Download and add a reference to
yahoo-dom-event.js
via something like this:<!-- YAHOO Global Object source file -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.2/build/yahoo/yahoo-min.js"></script>
You may also need to include other YUI .js files too depending on what you're doing. YUI can be modularized. See http://developer.yahoo.com/yui/2/ for exact details if you need to do that.