I saw another blog post today where someone was showing how to use a delegate control to add the jQuery library to every page on a site. While that does work, there is a newer and much more elegant solution that doesn’t require nearly the same amount of work: the ScriptSrc attribute introduced in SharePoint 2010.
I’ve only found two downsides to this approach. The first is that the jQuery library isn’t being pulled from a CDN like Google or Microsoft’s hosted options. I prefer to pull from these as it’s likely the user has already pulled from them before and it’s cached on their machine. The other downside is that I’ve seen this approach break the Asset Picker in SharePoint 2010 Publishing [WCM] sites.
One parting thought: I don’t think it’s a good idea to globally add a script to every page UNLESS you need it on every page. Else you’re simply adding page weight for no good reason.comments powered by Disqus