You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thorsten Hans edited this page Oct 28, 2013
·
2 revisions
ShareCoffee.CSOM provide helpers for working with JavaScript CSOM in SharePoint-Hosted Apps. If you're building Auto-Hosted or Provider-Hosted Apps, you should examine the ShareCoffee.CrossDomain Namespace.
ShareCoffee.CSOM.getHostWeb
When writing SharePoint-Hosted Apps you're often faced with the requirement to interact with data sitting in the HostWeb. You can use ShareCoffee.CSOM.getHostWeb in order to access data sitting in your HostWeb.
Usage
varctx=SP.ClientContext.get_current();// ctx is for working with your AppWebvarhostWebUrl=ShareCoffee.Commons.getHostWebUrl();varhostWeb=ShareCoffee.CSOM.getHostWeb(ctx,hostWebUrl);// hostWeb is the acutal hostwebvarblogWebUrl=hostWebUrl+"/my-blog";varblogWeb=ShareCoffee.CSOM.getHostWeb(ctx,blogWebUrl);