Post with nested codeblock -2

Post with nested codeblock -2

Oct 31, 2025

Installation

  • Insert the loadExternalFiles function into your Knack app's JavaScript editor:

    function loadExternalFiles(files) {
      KnackInitAsync = function ($, callback) {
        Knack.showSpinner();
        window.$ = window.jQuery = $;
    
        let loaded = 0;
    
        files.forEach(file => {
    
          el.onerror = () => {
            alert(`Error loading ${file.url}. Please refresh and try again.`);
            Knack.hideSpinner();
          };
    
          document.head.appendChild(el);
        });
      };
    }
  • Insert the function call code at the top of your code, adjusting the array items to suit the library(s) that you want to import.

    loadExternalFiles ([
      { type: 'script',module: false,url: ''},
      { type: 'link', module: false, url: ''},
    ])
Подобається цей допис?

Купити для Albert Fernandes книга

Більше від Albert Fernandes