Skip to main content

Posts

Showing posts with the label Client Object Model

SharePoint 2010 ECMA Scripts code snippets

ECMScript  ECMScript you need to create a client context before you can retrieve data from a SharePoint site. With ECMAScript you can retrieve the client context from the SharePoint site in which the script runs. Use the Load method to specify which data to load from SharePoint. Use the asynchronous method executeQueryAsync to retrieve the information from SharePoint. This method needs a reference to a callback method when the execution succeeds and a reference to a callback method when the execution fails. To Set and Get the Properties there are ways to get the information. get_methodname set_Methodname example  get_web(),  set_title etc Update, Insert, Delete Code snippets 1. Load Site Data   <script type="text/javascript"> var clientContext = null; var web = null; ExecuteOrDelayUntilScriptLoaded(Initialize, "sp.js"); function Initialize() { clientContext = new SP.ClientContext.get_current(); web = clientConte...