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:
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.
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.
Now add a new item and choose Application Page. Name this page JavaScriptOM.aspx.
Visual Studio automatically creates a
Layouts
folder and a subfolder underneath it called JavaScriptOM. Inside this folder you should see your ASPX page.In this page, add the code and get the items from the contacts list. Your application...