Articles about European Sharepoint Hosting Service
SharePoint 2013 Hosting – HostForLIFE.eu :: How to Change SharePoint Site Title Using JavaScript Code?
In this tutorial, i will show you how to change SharePoint Site Title Using JavaScript Code. Edit SharePoint Page and insert the script editor:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
<script language="javascript" type="text/javascript"> //Ensure the Client Object Model is ready before you use it ExecuteOrDelayUntilScriptLoaded(GetTitle, "sp.js"); function btnUpdate_onclick() { //Update the site's Title property site.set_title(document.getElementById("txtbutton").value); // site.update(); site.update(); // addd the site to Query queue context.load(site); //Run the Query on the server context.executeQueryAsync(onTitleUpdate, onQueryFailed); } function onTitleUpdate() { alert('Title has been updated'); //Refresh the page SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK); } var site; var context; function GetTitle() { //Get the current client context context = SP.ClientContext.get_current(); //Add the site to query queue site = context.get_web(); context.load(site); //Run the query on the server context.executeQueryAsync(onQuerySucceeded, onQueryFailed); } function onQueryFailed(sender, args) { alert('Request failed' + args.get_message() + '\n' + ar.get_stackTrace()); } function onQuerySucceeded(sender, args) { document.getElementById("txtbutton").value = site.get_title(); } // ]]> </script> <p> <input id="txtbutton" type="text" /> </p> <p> <input id="Button1" type="button" value="button" onclick="return btnUpdate_onclick()" /> </p> |
I hope, it works for you!
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.
Print article | This entry was posted by Peter on August 9, 2016 at 5:07 am, and is filed under Other Related Post. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |