Summit 7 Team Blogs

SharePoint & jQuery Starter Scripts

Super quick blog post for you guys. It struck me today the amount of times I have to go to an old script to copy and paste out my script references because I’m too lazy to type them out.

So, here are two scripts that you can drop into SharePoint as a starting point. The first one will get you ready to use SPServices and the second script is for using jQuery and the JavaScript Client Side Object Model (CSOM).

Both scripts reference jQuery from a CDN, so if you have your scripts stored somewhere else be sure to update that.

SPServices and jQuery

<script  type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>

<script type="text/javascript">
jQuery(document).ready(function($) {
alert("Okay! Let's get started!");



Client Side Object Model (CSOM) and jQuery

<script  type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>

<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(PageLoaded, "sp.js");

function PageLoaded()
alert("Okay! Let's get started!");


Okay, so maybe I’m the only one that needs these things lying around. At least I know where to grab them now.



The sample scripts are not supported under any Summit 7 Systems standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Summit 7 Systems further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Summit 7 Systems, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Summit 7 Systems has been advised of the possibility of such damages.

About Mark.Rackley