Ok - another seemingly basic function.

Once you were able to insert a webpart into a list - add custom script, text, what ever you needed. I am looking how and where I would find this sort of functionality. For example - I would like to change the form button names - this is easy enough to do if you can embed or attach the script.

Can anyone shed some light on this one? - just moved to this platform and discovering all the things it does and does not do.

  • You can use the content editor or Script editor web part in classic experience. – Ganesh Sanap Nov 21 '19 at 6:05

For classic page, you could just add Script editor web part by editing the page.

enter image description here

For modern page, it's a bit complicated. You need to deploy react script editor web part to your site:https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor. Then you can embed custom script.

| improve this answer | |
  • I have a modern communication site – garvon-77 Nov 21 '19 at 9:50
  • 1
    For modern page, you have to deploy the react script editor web part as I mentioned. – Michael Han_MSFT Nov 21 '19 at 9:56

Adding the Script Editor Web Part to Your Site:

  1. Open the page where you wan to add the webpart and From here, click on the Setting icon on the upper right and select Edit Page

  2. On the Edit page, select the Insert Web Part tab from the Ribbon. From the Categories menu, select Media and Content and then Script Editor from the Parts menu

  3. Click on the Add button at the bottom of the page to install the Web Part. Embedding Code to Your Site

  4. Once the Web Part has been successfully installed on your page, you will see a hyperlink button under the Script Editor labeled EDIT SNIPPET. Click the EDIT SNIPPET link to insert HTML/Script code:

  5. After you have inputted the appropriate code in the Embed dialog box, click Insert to save the HTML/Script. Click the Save button on the right corner of your site

  6. Once you have successfully completed the embed, you will see the results of your code displayed on your page.

The same steps can be followed, instead of Script Editor you can select "Content Editor Webpart". All this works in classic experience.

For more information - https://support.shortpoint.com/support/solutions/articles/1000265208-how-to-add-javascript-code-to-a-page-using-the-script-editor-web-part

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.