tags:

views:

35

answers:

2

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&amp;2.8.1/build/dom/dom.js&amp;2.8.1/build/event/event.js"&gt;&lt;/script&gt;
</Content>

<Content type="html" view="YahooFullView, canvas" href="http://www.myapp.com"&gt;
  <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.1/build/yahoo/yahoo.js&amp;2.8.1/build/dom/dom.js&amp;2.8.1/build/event/event.js"&gt;&lt;/script&gt;
</Content>

A Firebug Screenshot is below

here

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?

A: 

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"&gt;&lt;/script&gt;
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0/build/yahoo-dom-event/yahoo-dom-event.js"&gt;&lt;/script&gt;
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0/build/element/element-min.js"&gt;&lt;/script&gt;

Thanks

Haseeb Khan
You can skip the yahoo.js file. yahoo-dom-event.js is a rollup of yahoo-min.js, dom-min.js, and event-min.js.
Luke
Thanks Luke. I figured that out.Thanks again for pointing out.
Haseeb Khan
A: 

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.

Jackson