You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
Hi thank you for such a great plug-in I am using it at my company. Can you add a onready function that would be used in a similar way as we use document ready in jQuery something like
$LAB.ready(function(){
// do stuff...
});
This will allow inline scripting if needed at any point without having to be at the bottom of the page in a wait() function.
I created this temporary function for my company since they use a lot of inline JavaScript this because of the CMS architecture, and the many different pages that needs to be maintained
(function(llb){
var api = {
events: [],
registerEvent: function(e){
api.events.push(e);
},
executeAllEvents: function(){
var length = api.events.length;
for(var i = 0; i < length; i++){
if ( typeof api.events[i] === 'function' )
api.events[i]();
}
}
}
llb.ready = api.registerEvent;
llb.run = api.executeAllEvents;
window.llb = llb;
})($LAB);
Then in the html I have this, where I run llb.run() at the bottom to execute the registered events
This was a very quick attempt to resolve some dependency issues on different pages (more than 1000 pages). I know you may come up with a better piece of code but the idea is that one can use a ready function that is triggered when javascript files are loaded and doesnt need to use the wait() function always.
I hope I am making any sense.
Thank you and thanks for contributing making the web faster. ;-)
JB
The text was updated successfully, but these errors were encountered:
Hi thank you for such a great plug-in I am using it at my company. Can you add a onready function that would be used in a similar way as we use document ready in jQuery something like
This will allow inline scripting if needed at any point without having to be at the bottom of the page in a wait() function.
I created this temporary function for my company since they use a lot of inline JavaScript this because of the CMS architecture, and the many different pages that needs to be maintained
Then in the html I have this, where I run llb.run() at the bottom to execute the registered events
And now I can use something like this in any section of any page.
This was a very quick attempt to resolve some dependency issues on different pages (more than 1000 pages). I know you may come up with a better piece of code but the idea is that one can use a ready function that is triggered when javascript files are loaded and doesnt need to use the wait() function always.
I hope I am making any sense.
Thank you and thanks for contributing making the web faster. ;-)
JB
The text was updated successfully, but these errors were encountered: