| Page 1 of 1 | [ 4 posts ] |
Deeptechtons
|
I am getting started with YUI3 console widget and followed the instructions here http://yuilibrary.com/yui/docs/console/. But i downloaded the
Code: yui.min.js from the cdn and also the urls that were requested when i used Code: YUI().use("console",function(y){}); i understand that the Y it referred to was from within the callback function provided to execute after console is loaded so i changed such that yui.min.js was loaded first and then the console class loaded next through below codeCode: <script src="js/yui.min.js" type="text/javascript"></script> <script src="js/console.js" type="text/javascript"></script> and i loaded the application file adding script reference and this is the code inside the file Code: // In fact, you often don't even need to store the instance new YUI.Console({ logSource: YUI.Global }).render(); but i am greeted with the error Uncaught TypeError: undefined is not a function Am i fundamentally doing something wrong? |
|
Yes, you are fundamentally doing something wrong
If you want to include all the JS/CSS on the page without loader, you need to visit the Dependency Configurator and select the modules you want to use. That will generate the script and link tags needed to load the JS and CSS for that module. http://yuilibrary.com/yui/configurator/ Or, you can use Loader and have it do all the work for you: Code: <script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script> <script> YUI().use('console', function(Y) { (new Y.Console()).render(); }); </script> Check out the Quick Start tutorial for more details: http://yuilibrary.com/yui/quick-start/ |
Deeptechtons
|
Hi @Dav thanks for answering the question. I would like to just ask another simple question when the code
Code: YUI().use("console") is executed i could see that the url requested in the Request tab of Chrome Web Inspector is same as that when configured through the YUI configurator (means the dependencies and all the required stuff to use console was downloaded from the cdn in single request). Hence i copied the contents of that file for that request and created console.js file i mentioned in original post. What difference does this make |
|
The difference, is that we have several modules in our system that load other modules based on a condition (IE, supports Canvas, etc). So if you grab the URL from one browser it may not be the right URL for the other browser.
|
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group