I'm loading a javascript file using jquery
with the usual:
// file application.js
$.getScript("module.js", function(data, textStatus, jqxhr) { ... });
So far so good. Except that module.js
uses a function declared in another module i.e., it contains the statement:
// file module.js
import { myFunction } from './library.js';
When the browser loads my application, it complains that:
Cannot use import statement outside a module
Is there a way to load the script module.js
as a module?
Thanks