Conventional jQuery function works using my_function() but elgg.my_plugin.my_function doesn't work?
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.
Try
Doesn't work, it says the function isn't defined.
Sure, you should provide it:
But for Elgg 2.0 it's not recommend (use modules instead of)
I don't wanna split my JS into multiple modules, I prefer to have them in one file.
That's what I'm doing on our projects too ;) Just use the above examples.
Yeah I'm just gonna have to use regular jQuery for that one specific function lol.
Any particular reason you don't want to use modules?
I'd have to learn a whole new structure, which would hinder my new theme development which involves 99% ajax. I'll eventually learn it one day.
Here's our snippet which makes our websites 100% AJAXify.
We use HistoryJS for it and combine different methods.
For async load HistoryJS we use definition function:
For initialize history's tools/functions we provide it into views path:
Nice! If you don't mind, I want you to check out my new theme once it's done. Here's a preview of the landing page: https://drive.google.com/file/d/0BzzvL4ngEoyfQTY2ZXpOSmVLVUk/view?usp=sharing
- Previous
- 1
- 2
- 3
- 4
- Next
You must log in to post replies.