Load javascript after page is completely loaded
Posted: 19 Sep 2016
In sharepoint I need to load javascript after page is completely rendered.
So this is what I did:
function LazyLoad(){
console.log("JS loaded after page rendering");
}
_spBodyOnLoadFunctionNames.push("LazyLoad");
I guess, _spBodyOnLoadFunctionNames can not access "LazyLoad" function because it is not defined globally. How to load the function "LazyLoad" after everything is initialized?
So this is what I did:
function LazyLoad(){
console.log("JS loaded after page rendering");
}
_spBodyOnLoadFunctionNames.push("LazyLoad");
I guess, _spBodyOnLoadFunctionNames can not access "LazyLoad" function because it is not defined globally. How to load the function "LazyLoad" after everything is initialized?