How much does jQMobile depend on jQuery?

I created an application using jQuery mobile. In addition to some compatibility issues on different Android devices, I ran into extremely poor performance on the Android system. Since even a clean template from jquerymobile.com runs slowly on my galaxy tab, I decided that perhaps removing unnecessary parts of jQuery would speed it up. But has anyone tried this already? Is it possible?

+4
source share
3 answers

Cannot start jQuery Mobile without jQuery. (which is for people who may come here and not know this already)

You can try to reduce the size of JQ and JQM. Unfortunately, I do not think there is much to remove from jQuery. I will let him think and edit;)

But you can clear jQuery Mobile because it consists of widgets. Get JQM from github, read about β€œcompiling”, and you'll find out what to do. I plan to do the same, so I'm pretty sure it can be done. If you are not using selectboxes, you can simply remove the widget from the manifest file, and after making it, the CSS and code should not get into the assembly. That way, you can easily squeeze JQM down (my guess) by about half the size, if you don't use any form elements, collapse lists, etc., And the basics should work anyway.

[edit]

Possible jQuery compression will be difficult , but you can try removing:

  • new pending ajax processing (if it is not too deeply integrated)
  • animation
  • $. css (maybe I'm not sure if JQM uses this or not, but this is a big piece of code, and you can do without it)

The best way to do the recycling is to replace the body of the function, which, in your opinion, you will not need, with alert('damnit!') , To see if you really need it;) To be sure that it remains functional and stable , you must replace the functions associated with the names. Try not to replace or remove any closures or functions that return functions.

And do it AFTER AFTER YOUR TESTED code so that it always works correctly. Repeat tests after spoiling J *

+3
source

I think the true problem is not in Javascript. This is caused by HTML and CSS added by jQuery Mobile. JQuery Mobile will add div and CSS wrappers to the original HTML. The provided HTML is bloated with additional divs and CSS slows down performance.

you can try an already processed webpage without jQuery and jQMobile javascript on iphone. When fast scrolling, it is still slow and blinking. Another iUI structure http://code.google.com/p/iui/ works better in a long list because html code and CSS are simpler. Or you can compare it with a simple long list without CSS:

  <ul> <li> 1 </li> <li> 2 </li> ... <li> 500 </li> </ul> 
+3
source

I have tested a lot lately with jQuery and jQuery Mobile, and I have not noticed any problems on my ipad2. I suspect that a lot will be related to how you want to maintain outdated equipment. Mobile space is moving fast, and I predict it will be like the late 90s, when cross-browser support (not to mention limited options for supporting multiple screen resolutions then) required a mess of scripts and redirects based on things like user discovery agent.

+1
source

All Articles