PDA

View Full Version : Javascript Tab Panel



ideawire_bb
7 Nov 2006, 9:19 AM
I'm very interested in the work you've done with the JS Tab Panel, but I've not been able to figure it out yet.

I began by downloading your source code from (http://www.jackslocum.com/yui/2006/08/26/a-javascript-tabpanel-for-yahoo-ui/) and downloading all the files to the appropriate location on the server. I've commented out the second panel to keep this example as simple as possible.

I have a single error which is preventing the UI from displaying:
"YAHOO is not defined"

Which I believe is a result of this line:

YAHOO.util.Event.on(window, 'load', initUI);

These are my includes:

<link>
<script>yahoo.js</script>
<script>dom.js</script>
<script>events.js</script>
<script>dragdrop.js</script>
<script>animation.js</script>
<script>connection-min.js</script>
<script>yui-ext.js</script>
<script>util.js</script>

Am I missing the proper util.js file? If so, where is it located?

Thanks in advance for any help offered.

zpao
7 Nov 2006, 1:47 PM
first: this is how Jack has done the layout initialization in his examples

YAHOO.ext.EventManager.onDocumentReady(Layout4.init, Layout4, true);

second: that's not the proper way to load JS into the document, maybe you just over simplified it to make it easier to see, but if not here's the right way...

script type="text/javascript" src="javascripts/yui/build/yahoo/yahoo-min.js"></script>
// opening < removed so it would show up

The problem you're having comes from the fact that the Yahoo! JS library isn't being loaded at all, not that the util.js file isn't being loaded (I'm not loading it at all). Check to make sure that the files are being loaded into the document like above. Also make sure you have your directories right. I kept everything in the directories they came as opposed to throwing everything into 1 directory.

Hopefully this helps :)