question

MohamedRiyazM-3281 avatar image
0 Votes"
MohamedRiyazM-3281 asked MichaelHan-MSFT answered

How to develop a web part to embed a script tag in SharePoint?

Since SharePoint 2019 has removed Content Editor web part and Script Editor web parts from Modern site templates, I want to develop my own web part to just place a script tag in it


I need to add this web part to certain modern pages. The source code on this JS file is simply to open a dialog page in order for SharePoint users to do Live

office-sharepoint-server-customization
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @MohamedRiyazM-3281 ,

This spfx web part would work for you: react-script-editor-onprem

Just deploy it to your site.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MohamedRiyazM-3281 avatar image
0 Votes"
MohamedRiyazM-3281 answered

Thank you very much for the solution. But as I am new to SharePoint development, would you please advise me on how to deploy this on my SharePoint 2019 on-premise server?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @MohamedRiyazM-3281 ,

Then I suggest you read the below article to learn about sharepoin framework: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview

And build and deploy your first Hello World web part: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part

To deploy the react-script-editor-onprem, you could refer to this step by step: https://social.technet.microsoft.com/Forums/en-US/d4b8b3c4-8950-4407-9120-204b80fc35f9/sharepoint-online-best-practice-install-modern-script-editor-web-part-for-sharepoint-online?forum=odspproductsandservicesharing


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.