SharePoint 2013 - Changing Master Page through CSOM
This article explains how to change a Master Page using JavaScript CSOM. In many cases, project requirements require us to use client scripting rather than server-side deployment. In one of my assignments, I was asked to change a MasterPage without involving the Farm administrator’s efforts and CSOM comes to the rescue. The following is the code snippet that does the job for us.
<script>
function MastePageChange() {
var clientcontext;
var cweb;
var customMasterURL = '/_catalogs/masterpage/NewMasterPage';

Join the conversation! Your thoughts help the community grow.