Navigate to your SharePoint 2013 site and create a Wiki Page or a Web Parts page.
Edit the page, go to the “Insert” tab in the Ribbon and click the “Web Part” option. In the “Web Parts” picker area, go to the “Media and Content” category, select the “Script Editor” Web Part and press the “Add button”.
Notice that as soon as you insert your code, you will see a preview of how it will be displayed in the site page.
- Once you are done, press the “Insert” button and check your code works as expected.
1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
6: //This function reads the digest using /contextinfo.
7: function ShowAlert()
9: alert("Hello World from SP 2013 Script");
15: <input type="button" value="Show Alert" onclick="ShowAlert()";/>
Finally, bellow you can find a screen shot of the page working as expected.
And that’s all about how to insert custom logic in the client side of your SharePoint sites. I recommend you to check how it works in your SharePoint 2013 CloudShare environment.