开发者

YUI not recognized

开发者 https://www.devze.com 2023-03-03 23:36 出处:网络
I have this page that has a JS error about the YUI JavaScr开发者_StackOverflowipt library not being recognized:

I have this page that has a JS error about the YUI JavaScr开发者_StackOverflowipt 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!!


You must include the javascript YUI too. Not only the css

You will need YUI 3 for your route.js try add this :

<!-- JS -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.3.0/build/yui/yui-min.js&3.3.0/build/json/json-min.js&3.3.0/build/oop/oop-min.js&3.3.0/build/dom/dom-base-min.js&3.3.0/build/dom/selector-native-min.js&3.3.0/build/dom/selector-css2-min.js&3.3.0/build/event-custom/event-custom-base-min.js&3.3.0/build/event-custom/event-custom-complex-min.js&3.3.0/build/event/event-min.js&3.3.0/build/pluginhost/pluginhost-min.js&3.3.0/build/dom/dom-style-min.js&3.3.0/build/dom/dom-style-ie-min.js&3.3.0/build/dom/dom-screen-min.js&3.3.0/build/node/node-min.js&3.3.0/build/event/event-base-ie-min.js&3.3.0/build/querystring/querystring-stringify-simple-min.js&3.3.0/build/queue-promote/queue-promote-min.js&3.3.0/build/datatype/datatype-xml-min.js&3.3.0/build/io/io-min.js"></script>

or just:

<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>


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


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.

0

精彩评论

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

关注公众号