Let jQuery Mobile not show methods that hate the loading interface

  • 2020-03-30 01:46:58
  • OfStack

One of jQuery Mobile's bugs is that when ajax is not used and his own back returns, that is, when he clicks the browser's back button, the page will be loaded from the cache. At this point, the annoying loading animation appears and does not disappear. I found a lot of solutions on the Internet, and searched for a long time, but it was not easy to use. Today, I suddenly thought of pulling the plug and directly touched the class library of jqeury-mobile.

Open it with the editor,

Find the method to display pageLoading, the definition of showPageLoadingMsg:

Then add a code, if("". Length< 5) return; Disable this method.
 
showPageLoadingMsg:function(){if("".length<5)return; 

Save and refresh the test. Remember not to appear in Chinese, otherwise you need to modify the JS file encoding format.

OK, solved.

But in my opinion, if I need to use that method later, there is no way. It won't work. The solution can be: pollution, coupled global variable determination, that is, set a global variable, in this method if determination, whether to force return.

If you have any questions, please feel free to contact me. QQ: 551996458.

Related articles: