I am having problems with elgg_require_js API. Though the js files are loaded, its not getting executed.
Here is my scenario
<?phpfunction test_init() {elgg_require_js('js/test');}return function() {elgg_register_event_handler('init', 'system', 'test_init');};
define(function(require) {
var elgg = require("elgg");
var $ = require("jquery");$('body').append(elgg.echo('hello_world'));
});
In the network tab of my browser, I can see the js file got loaded, but nothing is getting appended to the body.
Any thoughts?
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.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Sarath@sarathsince85
Sarath - 0 likes
You must log in to post replies.not
Read this also.
Thanks RVR. I followed the instruction given in the tutorial pages.
http://learn.elgg.org/en/2.0/guides/javascript.html#executing-a-module-in-the-current-page