Hello,
I'm trying to develop a plugin that uses Google maps to show a map in a page, this part was working in Elgg 1.1X but no more in Elgg 2.x
, the error I got in Chrome console is: Uncaught ReferenceError: $ is not defined in a JS code like:
<script type='text/javascript'>
$(document).ready(function () { frn_initialize(); });
I use xampp in Windows 7 and windows 10 (same environment and same code in Elgg 1.11.0 works fine)
There is some change in the way JS / GoogleMaps are to be used in Elgg 2.x ?
Thanks!
Fabrizio
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.
- Matt Beckett@Beck24
Matt Beckett - 0 likes
You must log in to post replies.Yes, all scripts in Elgg 2 are loaded asynchronously using requirejs. It looks like you're calling this from an inline script so it tries to fire before jquery has been loaded.
The proper solution is to convert your plugin js to AMD modules - http://learn.elgg.org/en/2.0/guides/javascript.html
A quick not-as-good-but-should-work solution is to wrap it in a require call