Skip Ribbon Commands
Skip to main content
Sign In

Customer Service: 1-855-594-9266

canada flag

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 5/4/2021 10:42 PM by Igor Goldshtaub (UTC-05:00) Eastern Time (US and Canada)
Total Views: 54

Tags

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