Here are some good places you cant start.
Join the Community
Get updated about all the good stuff!
Modules are the mechanism available to us in Javascript in order to split the code logic into separate files. This becomes increasingly important when your codebase increases.
Instead of including all of your Javascript inside the JS Tab of the widget creator, you can split your code into logical pieces within one or more separate files in your Widget Asset Folder and then consume those modules from the JS Tab. This will help you unclutter the JS Tab and results in a codebase that is more easily maintainable and extendible.
If you have some utility functions or custom code that you regularly copy/paste into the
JS Tab on your widgets. It makes sense to turn that common logic into modules. If you
need to make a change to that code in the future, you only have to change the module
and upload the new version to the widgets that use it. The alternative would be to
search every widget that uses it, locate the relevant code in the JS Tab and then replace
it.
Some libraries, open-source or otherwise, only come in the form of ES6 modules.
One free benefit of using modules is you reduce the amount of JS that is loaded when you have more than one instance of the same custom widget on the same page since all widgets use the same module(s). And if you are using the same widget on different pages, on the subsequent pages, the module(s) will be loaded from the browser cache instead of downloading it again from the server.
Modules can be imported Statically or Dynamically depending on the requirement of the code you are working with.
Using the JS/CSS Include tab, you can access the option to include the js file as a
module via the include settings.
You can include modules in the JS tab using the import statement at the beginning of the
Editor.
Code sample for copy/paste conveniene: Click To Download
You can import modules dynamically using the Import() function.
There are 2 ways to do so. With “load as module” checked, or without.
The static way requires the ‘load as module’ at the bottom to be checked.
The dynamic way doesn’t
Plans & Pricing
Unlock access to all our premium widgets and features.
The above prices do not include applicable taxes based on your billing address. The final price will be displayed on the checkout page, before the payment is completed.
You are fully protected by our 100% Money Back Guarantee 30 day trial period.
We accept all major credit cards including Visa, Mastercard, American Express, as well as PayPal.
Your information is protected by 256-bit SSL encryption identity verification and data security.
Build sophisticated websites in less time.
Stop wasting time searching for widgets. Find everything you need in one place.
Get instant access to tons of Elementor goodies, completely FREE!