Why is $ shorthand disabled?
-
Need to write jQuery and not $. This breaks third party js libs. Whats is the correct way to include 3party modules only when the plugin is used. In my case a widget that is only used on one page.
-
It's not disabled, works just fine.
-
If you use it in a template file, then its disabled.
I get
Uncaught ReferenceError: $ is not definedfrom
$(document).ready(function(){ $("#msgid").html("This is Hello World by JQuery"); }); </script> This is Hello World by HTML <div id="msgid"> </div>
What is the correct way to load jQuery into a plugin? Do I you use plugin.json to enable this?
"scripts": [
"static/lib/main.js"
],
"acpScripts": [
"static/lib/admin.js"
],Should scripts be used for public scripst to like jquery? Jquery must be enabled by default right?
-
If you have your code in the scripts in plugin.json, jQuery will be available when they run.
Scripts in templates can run before jQuery loads into the page.
-
ok, so html widgets and template files need to check if jQuery is loaded. But script added by script tag in plugin.js allways have jquery support