Dynamically Importing JavaScript

后端 未结 3 985
悲哀的现实
悲哀的现实 2021-01-13 16:52

What is the correct way to dynamically import JavaScript (.js) files into a parent JavaScript code, please?

I am using the following code, but it seems not correct:<

3条回答
  •  独厮守ぢ
    2021-01-13 17:29

    In svk.js add the following (after the variable deceleration):

    svkLoaded();
    

    In the master code file add the following:

    function svkLoaded()
    {
        alert("Pet Name: " + PETNAME);
    }
    

提交回复
热议问题