In this tip, I have explained how JavaScript can be used for creating a subsite in SharePoint 2013 and Online sites. Before starting with the code, we need to add the following JS references in our page: <script src="/_layouts/15/sp.runtime.js" type="text/javascript"> </script> This script file is only for On Premise Servers and not for SharePoint online, because it’s already there in SharePoint online. When we are creating a site programmatically, we need the template’s internal code. For example, if we create a Team Site, we need to use STS#0 (which is an internal code for Team Site template) in our program. Similarly, creating a site using a custom Web template, we need to get the internal code of the template first. We need to iterate through the Web template collection to retrieve our custom template with the title provided, while saving the template. The template code is stored in the name property of the Web template. Here, is the code for creating the sites in SharePoint online plus its designing part:
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: