While I absolutely loathe the term "Best Practices", it's time to dive into a topic that really hasn't been talked about but should have by now. I'm *not* going to label this post as a "Best Practice", although I'd like to, but label it more like: this is what I do and why...
Adding Script to Pages
It's well known that most of the front-end developers favor using CEWP's to inject script into our pages. Many well known webparts use this technique. This is great! We can add functionality to my pages with a small amount of work and without using SharePoint Designer.
Here's my list of considerations when adding a new CEWP to my page.
- What will this script potentially do over the life of this application?
- Do I think this could grow over 1 KB?
- Does the page weight even matter for this application?
- Will I gain anything by caching these resources?
What I Do
This is what I do though.