SharePoint 2010 offers client side object model for interacting with SharePoint content DB and Config DB.SharePoint API can be invoked from Javascript and Silverlight.Namespace and classes are similar to ServerSide ones.
Request to server are made in the XML form and return data comes as JSON response.This new feature of SharePoint offers exciting options for developing SharePoint UI.Inclusion of JSON in SharePoint APIs is great addition to the repertoire of SharePoint developer.I am particularly interested in JavaScript OM.The way it works is consequite server request are accumulated and sent in one shot to reduce server traffic.Technology has to be similar to Ajax of posting asynchronous XMLHTTP request to server.
Silverlight has new RIA framework to go along with it.In future RIA may get used in SharePoint developement.The javascript library for new ECMAScript OM is located in new ’14Hive’ “Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS” in file sp.js. This can be reference from pages like <SharePoint:ScriptLink Name=”sp.js” ………. />
Sample javascript code:
<script language=’javascript’>
var ctx=new SP.ClientContext.get_current();
this.web=ctx.get_web();
ctx.load(this.web);
ctx.executeQueryAnync(Function.createDelegate(this,this.onSuccess),Function.createDelegate(this,this.onFail));
function onSuccess(sender,args)
{
alert(this.web.get_title());
}
function onFail(sender,args)
{
alert(args.get_message());
}
</script>
Reference Article:
http://www.codeproject.com/Articles/60348/SharePoint-2010-Client-Object-Model-for-JavaScript.aspx