Enable Library (jQuery)

I want to include two libraries (jQuery, Highcharts). I tried adding them as extra js in the config.json file:

"additional-js" : { 
    "add-script" : [
       { "uri" : "script/jquery-3.1.0.min.js" },
       { "uri" : "script/highcharts.js" } 
    ] 
},

The problem is that the sequence of inclusions is changed by string. After the build, highcharts.js is the first included. How can I control the sequence?

+4
source share
2 answers

And here is a direct answer to your question:

I tested this with a freshly created application, and the sequence specified in config.jsonIS was saved.

You must first place the additional library files in the correct path of your application (here called myapp) in

  myapp/source/resource/scripts/jquery.js
  myapp/source/resource/scripts/highcharts.js

Then add an entry to the jobsection linemyapp/config.json

  "jobs" :
  {
    "common" : {
      "add-script" : [
           { "uri" : "resource/scripts/jquery.js" },
           { "uri" : "resource/scripts/highcharts.js" }
        ]
    },

, , @asset(scripts/*) - , . Application.js,

/**
 * This is the main application class of your custom application "myapp"
 *
 * @asset(myapp/*)
 * @asset(scripts/*)
 */

, jquery.js, highcharts.js .

, qooxdoo . script index.html!

+4

, . add- script config.json.

jquery highcharts qooxdoo, qx.util.DynamicScriptLoader (. http://www.qooxdoo.org/devel/api/#qx.util.DynamicScriptLoader), , . , , , , , .

+2

Source: https://habr.com/ru/post/1655488/


All Articles