问题
We have created a SharePoint Communication site with Modern UI. We need to execute some Javascript code for chatbot integration. All we have to do is just reference some external js files.
How this can be achieved as modern UI blocks client scripting?
回答1:
You need to create a 'classic' page because, as you mentioned, JS cannot be executed in modern pages.
To do this:
Go to: Site Content-Site Pages.
Click on 'New' then either create a 'Web part' or 'wiki' page.
Then, in that page, simply click on settings(the cog icon at the top of page) then select edit this page.
Then insert content editor web part, where you can add the JS code.
See this link for more info: http://www.isaca-northtexas.org/SharePointTraining/TrainingPages/ContentEditorWebPart.html
来源:https://stackoverflow.com/questions/52715031/javascript-in-sharepoint-modern-ui