Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. createWebsite(1045);
  2. function createWebsite(languageId) {
  3.  
  4. var clientContext = SP.ClientContext.get_current();
  5. this.oWebsite = clientContext.get_web();
  6.  
  7. var webCreationInfo = new SP.WebCreationInformation();
  8. webCreationInfo.set_title('My 1045 website');
  9. webCreationInfo.set_description('Description of new Web site...');
  10. webCreationInfo.set_language(languageId);
  11. webCreationInfo.set_url('My1045WebSite');
  12. webCreationInfo.set_useSamePermissionsAsParentSite(true);
  13. webCreationInfo.set_webTemplate("STS#0");
  14.  
  15. oWebsite.get_webs().add(webCreationInfo);
  16. oWebsite.update();
  17.  
  18. clientContext.executeQueryAsync(function() {
  19. console.log("Done");
  20. }, function(sender,args) {
  21. console.log("failed. Message:" + args.get_message());
  22. });
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement