Hello. Question about the procedure for declaring the import of JavaScript files. Does it matter in the program, which script in the ad is higher and which is lower?
For example

 <script type="text/javascript" src="js/EditingTemplateWindow.ui.js"></script> <script type="text/javascript" src="js/EditingTemplateWindow.js"></script> 

UPD1 :
A type expression

 vasia = function() { // Вася беги!!! } 

is the executable part when loading a script?

    3 answers 3

    If these scripts have an executable part (and not just declarations of functions and variables), then they will be executed at the moment of inclusion. If they don’t, then there’s no difference (UPD: unless they have ads with the same name).

     //script1.js var a; //script2.js function b() { alert a; } //script3.js b(); // выполняемый во время включения! 

    Here, script1 and script2 can be included in an arbitrary order, and script3 must necessarily go after.

    • And an expression like vasia = function () {// Vasya run !!! } is the executable part while loading the script? - Anton Mukhin

    Yes, it has. In some cases, the program may not work correctly or will not start at all.
    Declare in order of inheritance: first the library, then the plugin.

      If EditingTemplateWindow.ui.js is more dependent on EditingTemplateWindow.js and vice versa, it has!

      You also need to observe the conflict of the scripts, for example:

      вася.js петя.js

      That petya may not work, and if:

      петя.js вася.js

      Then everything works wonderfully and there are no conflicts between the scripts.