By Gregor de Lijzer on Friday, 30 March 2018
Posted in Technical Issues
Replies 2
Likes 0
Views 749
Votes 0
By developing an app for ES i asked myself what's the difference between module, library and script. See this e.g.


EasySocial
.require()
.library('lib1')
.script('script1.js')
.done(function($) {
mycode
}


What are the different use case to use what?

Thanks Greg
.library
-> This something like you would like to load your extra js on the site
e.g. when i call this

.library("markitup")

, it will call load this js lib file.
../media/com_easysocial/scripts/vendors/markitup.js

.module
-> It like a declare the script namespace (this can be any name) so that you can call this name in any Easysocial page.
e,g.

EasySocial.module("story/blog", function($){
xxx
}


.script
So other page you can use this namespace to call, it like a call the module that was declared above

EasySocial.require()
.script("story/blog")
.done(function($) {
xxx
});
·
Friday, 30 March 2018 19:05
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post