I have created a Site Collection in SharePoint 2013 online.
I am able to execute the script successfully without any error. But when I refresh my home page, it redirects me to error page saying “File Not Found” Error and it gives one correlation ID. When I change any setting in Master Page and save it, my site again looks good.
code which I am using:
//context = new SP.ClientContext.get_current(); //var site = clientContext.get_site(); //var web = context.get_site(); context = new SP.ClientContext.get_current(); var web = context.get_site().get_rootWeb(); context.load(web, 'ServerRelativeUrl'); web.set_customMasterUrl('/_catalogs/masterpage/seattle.master'); web.set_masterUrl('/_catalogs/masterpage/seattle.master'); web.update();
I tried with commented code also for trial... Would appreciate if someone could give me some direction here.....