Is there a way to force javascript files to load in a certain order?
E.g. I need to load a.js first, then b.js, then c.js ... since b.js requires things that are defined in a.js, etc.
From what I can tell, the only way to do this in the UI is to upload them in reverse order (I even tried renaming them so they would sort alphabetically, but that didn't work).
This topic is no longer open for comments or replies.
-
Hello John,
This works as with standard JavaScript, please search online for details, for example: http://stackoverflow.com/questions/23... -
-
Alena,
Thanks, I do understand that the load order is important ... my question was how can I enforce a load order within Appery?
i.e. if I accidentally upload c.js then a.js then b.js, then the code won't run since the load order that Appery imposes is wrong.
How can I tell Appery that the order needs to be a.js, then b.js, then c.js?
(the only way I figured out is to delete all the javascript files and upload them in reverse order) -
-
Hi John -
Could you please clarify, how you are adding your JS files, by adding them as JS assets? -
-
-
Looks like this is the only possible way is to upload them in reverse order.
-
-
-
-
How about a feature request: give us some way to enforce an ordering (similar to what can be done for external resources)
:) -
-
-
-
The up/down buttons only show for external javascript code, not for JS-code that you upload yourself. It would be great to have something similar for uploaded JS-code!
-
-
I think having the ability to define the order of all js files included in the app is essential. If I want to override some jQuery Mobile init functions I simply cannot unless I edit the source file. This then makes the file completely uneditable in the visual designer which is one of the main benefits of using Appery. It's extremely frustrating not having more control over this.
- view 1 more comment
-
-
Hi Sergiy. I'm not using AngularJS but instead jQuery Mobile. Hopefully one wouldn't have to switch to an entirely different framework to be able to control the order of JS files :)
-
-
Dear Lisa,
We have added order possibility in JQM projects to our to-do list, but can not say any time frame.
Please stay tuned to Platform updates. -
-