I can add my javascript file here: views/default/js/<my_mod>/my_script.js
No need to register, I can call it any time I want with: elgg_require_js('<my_mod>/my_script');
the only dependency is jQuery which is always loaded anyway.
But what about caching & minifying? Should I register it as an AMD or am I good as is?
thanks
Ray
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Evan Winslow@ewinslow
Evan Winslow - 0 likes
- twentyfiveautumn@socialphp
twentyfiveautumn - 0 likes
You must log in to post replies.It all automatically works of you do it in the way you describe!
For jQuery, you should still require it in your amd module with
var $ = require('jquery');
Thanks Evan. will do