Skip Ribbon Commands
Skip to main content
Sign In

Adding Javascript file to modern page

Adding Javascript file to modern page


Question

How do I add Javascript file to modern page

Answer

  1. Add Data View Plus web part to the page
  2. In template editor go to Scripts tab
  3. In script editor create new script loadJS:
  4. In the script editor add the code:

    var script = document.createElement('script');
    script.onload = function () {
        //do stuff with the script
    };
    script.src = 'https://kwizcom.sharepoint.com/sites/st/SiteAssets/Test1.js';
    document.head.appendChild(script);
  5. Go back to HTML tab and add the  code there:

 

 



Created at 5/4/2021 10:37 PM by Igor Goldshtaub (UTC-05:00) Eastern Time (US and Canada)
Last modified at 6/1/2022 1:42 PM by Igor Goldshtaub (UTC-05:00) Eastern Time (US and Canada)
Total Views: 730

Tags

Article Type: How-To
Recent Discussions
There are no items to show in this view.