I have found this blog Adding a Blog to an Existing Site
I would like to know if there is something similar for SP in cloud (O365)?
Â
The code to to this is listed in the comments section of that blog post.
function ActivateWebFeature(web) {
var guid = new SP.Guid(‘{0d1c50f7-0309-431c-adfb-b777d5473a65}’);
var featDefinition = web.get_features().add(guid, true, SP.FeatureDefinitionScope.farm);
}
var context = new SP.ClientContext.get_current();
var web = context.get_web();
//Activate Features
ActivateWebFeature(web);
context.load(web);
context.executeQueryAsync(
function () {
window.console && console.info(“Featured activated for Web: ” + web.get_serverRelativeUrl());
},
function (sender, args) {
window.console && console.info(‘Error: ‘ + args.get_message() + ‘\n’ + args.get_stackTrace());
}
);