I am working on a Yahoo! App and want to utilize YUI Features available, however, I haven't figured out a way to include the YUI Libraries in my App as yet. I was of the opinion that the Libraries will be a part of the App by default but seems its not true in my case.
I have tried including the Libraries in my Code but it fails with an error that external files are not allowed, which makes perfect sense as inclusion of external Javascript and CSS isn't allowed.
I have also tried to include the Javascript in the Gadget XML but I am not sure where to put exactly. I am not sure if I have done it correctly and at the correct place, following is a snippet for reference:
<Content type="html" view="YahooSmallView, default">
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.1/build/yahoo/yahoo.js&2.8.1/build/dom/dom.js&2.8.1/build/event/eve开发者_运维知识库nt.js"></script>
</Content>
<Content type="html" view="YahooFullView, canvas" href="http://www.myapp.com">
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.1/build/yahoo/yahoo.js&2.8.1/build/dom/dom.js&2.8.1/build/event/event.js"></script>
</Content>
A Firebug Screenshot is below
I have a feeling that this might be available as a feature and I might have to do something similar but I am not sure:
<Require feature="yui-2.8" />
Can anyone in the community please provide some help with this issue?
Issue resolved. Included the following files in the code as External Javascript and it worked.
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0/build/yahoo/yahoo.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0/build/element/element-min.js"></script>
Thanks
Had the same issue. it appears that you can only use version 2.8.0 for now. If you look in the scripts above, it has 2.8.1 as the version. So for anyone else reading this, try doing 2.8.0 as the version.
精彩评论