Posts

Showing posts from January, 2015

Load JavaScript Files in SharePoint

Image
When you are coding SharePoint using JavaScript, you need to load JavaScript files, and SharePoint offers multiple ways to do that. The major methods are to register the file on a page, to always load the file by using the SharePoint CustomAction in Module and to load the file on demand by using the Script on Demand function. This is valid for all SharePoint versions. When a JavaScript file is registered on a page it is only available for that page, and this normally works good.  The problem comes when you are modifying the SharePoint ribbon using CustomAction and your CustomAction requires multiple JavaScript files. Then there are two loading methods available, to always load the files or to load them on demand.   It is not good to always load JavaScript files. It will slow down the entire SharePoint performance, because it loads the JavaScript files on ...