Using JavaScript Object Model

So far we have only used the Managed Object Model. IIn this recipe we will use JavaScript OM and list first five items of our contacts list.

Getting ready

You should complete the previous recipe successfully to follow this one.

How to do it...

In order to use the JavaScript Object Model, adhere to the following steps:

  1. If you have closed your Visual Studio IDE, launch it now as an administrator and create a new project of type Empty SharePoint Project. Name the project JavaScriptOM.
  2. By default, Visual Studio selects the SharePoint site available on the machine. Select Deploy as Farm Solution and click on Next to proceed to the next step in the wizard.
  3. Now add a new item and choose Application Page. Name this page JavaScriptOM.aspx ...

Get Microsoft SharePoint 2010 Development with Visual Studio 2010: Expert Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.