Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

JS file loading sequence

Hi Team,

I am trying to override the showSpinner and hideSpinner functions with empty funcitons. by adding:

showSpinner = function(){};
hideSpinner=function(){};

In my custom js file.
I find it sometimes working, sometimes, the spinner will still show?

Does it have anything to do with the loading sequence of the js file, how can I control the loading sequence of js files?

Thanks

Don

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

JS file loading sequence

Hello,

Once you have redefined a function, you will be able to use it in the future.

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

JS file loading sequence

Hi Sergiy , I want to disable the default spinner, that s why I am disabling the functions.but sometimes the spinner still show.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

JS file loading sequence

Did you make any changes in the Source tab?
Could you please provide us with exact steps to reproduce this issue/problem?

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

JS file loading sequence

Hi Sergiy,

I didn't change the anything in the source tab.
steps:

  1. create a js (e.g. script.js) file and add the following 2 lines of code in it.
    showSpinner = function(){};
    hideSpinner=function(){};

  2. invoke any ajax service on a page. Try invoke multiple times. Refresh the page and try again.

    You can see that sometimes the default spinner still appears.
    But the 2 lines of code should have already overwritten the standard spinner function.

    Don

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

JS file loading sequence

The real question I guess is the loading sequence of the java script files. Since it is not recommended to modify the source file, how can I control which js file gets loaded before/after another.

In this case, I want my new js file script.js to run at the last of all other js files. In that way, I can be sure that the spinner functions are over written.

Please help, thanks.

Don

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

JS file loading sequence

You can manage dependencies in AngularJS projects: https://devcenter.appery.io/documenta...
But for JQM projects you can see files' order in the index.html page

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

JS file loading sequence

Thanks, I don't have a index.HTML page in my JQM project . Do you mean the first page of the project?

I can see the sequence in the source file, is there a way I can change the sequence and still be able to use the design view to edit the page?
Because I know once I change a file in the source view, I won't be able to edit it in design view .

Don

Return to “Issues”