| Page 1 of 1 | [ 3 posts ] |
|
Here is my test code:
Code: <script type="text/javascript"> YUI({ modules: { 'jquery': { fullpath: 'script/lib/jquery.min.js' }, 'jquery-blockui': { fullpath: 'script/lib/jquery.blockUI.js', requires: ['jquery'] } } }).use('jquery-blockui', function(Y, result){ $.blockUI(); }); </script> When it run, sometimes it work, sometimes dont work. Because jquery lib loaded after jquery-blockui. errors like: Code: Uncaught ReferenceError: jQuery is not defined Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'blockUI' So, What's wrong with the code? |
Alberto SantiniYUI Contributor
|
Hello lupin.
Maybe it is due to async loading: http://yuilibrary.com/yui/docs/yui/#async Hope that helps, IceBox P.S.: If your custom modules are properly wrapped in a YUI.add callback, you will see no difference at all (async false or true), but this is not the case with external libraries. |
|
It work perfect.
Thank a lot. |
| Page 1 of 1 | [ 3 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