In this post we will discuss about an example in JavaScript example in SharePoint 2013.
Also you can check out:
- Shredded Storage new feature in SharePoint 2013
- Steps to create App Catalog site in SharePoint 2013
- Browsers supported in SharePoint 2013
In this example we will try to get the site collection url using JavaScript client object model.
var siteCollection;
var ctx = new SP.ClientContext.get_current();
siteCollection = ctx.get_site();
ctx.load(siteCollection);
ctx.executeQueryAsync(success, failure);
function success() {
var url = siteCollection.get_url();
}
function failure() {
alert("Failure!");
}
Also you can check out:
- Shredded Storage new feature in SharePoint 2013
- Steps to create App Catalog site in SharePoint 2013
- Browsers supported in SharePoint 2013
In this example we will try to get the site collection url using JavaScript client object model.
var siteCollection;
var ctx = new SP.ClientContext.get_current();
siteCollection = ctx.get_site();
ctx.load(siteCollection);
ctx.executeQueryAsync(success, failure);
function success() {
var url = siteCollection.get_url();
}
function failure() {
alert("Failure!");
}