Hi everyone.
I hope you had a good weekend.
I want to know how to use a third-party javascript in elgg. I am building module, and I am using more than one js file for my module. How to integrate such external js file in elgg ??
Could someone told me me where the jquery libraries are located in elgg ?
I read that it is recommended to use AMD (Asynchronous Module Definition) standard for writing JavaScript. I want to kown if I can run a non AMD (Asynchronous Module Definition) JavaScript code in elgg.
Best regard
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.
- ihayredinov@ihayredinov
ihayredinov - 1 like
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
You must log in to post replies.If you are using more than one JS file, you should be using AMD, as it will ensure that no one script runs before its dependencies are loaded.
If the external file is an exportable AMD module, you should register it:
Most scripts these days come as AMD module, e.g. moment.js, so you can register them and require them in your script:
You shouldn't need to know the location of jQuery. If you do, then you are doing something wrong.
Thanks a lot