I've got a problem with my plugin and js.
Without my plugin elgg works fine. But when i activate my plugin, i have the problem that in the river i can't see, who likes my entries. Get an error "Uncaught SyntaxError: Unexpected token" in lightbox.js.php:5 and on click i get the error "Uncaught TypeError: $.colorbox is not a function" in lightbox.cs.php:84
what is the problem? I work with elgg 2.0 and bootstrap. I tried to in start.php to write elgg_load_js('lightbox');
elgg_load_css('lightbox');
And then in the html.php i included it with the <script..... tag
What could be the problem? What i am doing wrong?
Please help me
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 - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
You must log in to post replies.elgg_load_js() loads the script asynchronously, inline JS is implemented synchronously at runtime before lightbox is loaded.
Try at least wrapping your JS as an init, system event handler, might help but not bullet proof. In 2.3, lightbox is an AMD module which solves that problem.
This will probably work in most cases, but might still fail on occasion.