SharePoint Client Object Model (ECMAScript) provides the capabilities of SharePoint Server Object capabilities at the client side. In this tutorial, let me show you how you can play around with the Client Object Model through IE Developer Toolbar.
Check the screenshot below, to know what we are trying to achieve here:
Below is the function that i have used:
function getWebProperties() {
var ctx = new SP.ClientContext.get_current();
this.web = ctx.get_web();
ctx.load(this.web);
ctx.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
Function.createDelegate(this, this.onFail));
}
function onSuccess(sender, args) {
alert(‘web title:’ + this.web.get_title() + ‘\n ID:’ + this.web.get_id() +
‘\n Created Date:’ + this.web.get_created());
}
function onFail(sender, args) {
alert(‘failed to get list. Error:’+args.get_message());
}ExecuteOrDelayUntilScriptLoaded(getWebProperties, “sp.js”);
The above ECMAScript access the SharePoint’s client context object. It is essential to note that “SP.js” is loaded before this script execution occurs. This is the reason for using the “ExecuteOrDelayUntilScriptLoaded” function.
wonderful post.Ne’er knew this, regards for letting me know.
An interesting dialogue is price comment. I believe that it is best to write more within this topic,
it won’t be described as a taboo subject but generally everyone is not sufficient to dicuss on such topics. To a new location. Cheers
you’re in fact a good webmaster. The site loading speed is amazing. It kind of feels that you’re doing any distinctive trick.
Furthermore, The contents are masterpiece.
you’ve done a magnificent activity with this subject!