Removing unused jQuery Mobile elements?

后端 未结 4 1708
醉梦人生
醉梦人生 2021-01-14 03:01

I\'m using jQuery Mobile beta. It\'s great fun to work with, but it\'s still very slow on a 3G connection.

It requires the following files:

http://c         


        
相关标签:
4条回答
  • 2021-01-14 03:19

    I know this is an old question, but here goes anyway: You can use the jquerymobile "download-builder" to create a custom build with only the components you need!

    0 讨论(0)
  • 2021-01-14 03:23

    You can get the whole build setup from github, remove widgets you don't need trom the manifest and build it then.

    On linux - just use make

    On Windows - you'll have to run the PHP build script

    0 讨论(0)
  • 2021-01-14 03:25

    there's no way to automate this process. If you want to go and remove what's not being used you have to do it yourself. But your gain will be minimal. You won't reach 25kb in any of them.

    Use html5 cache manifest to store the files locally and as you've said only the first load will be slower. No way around it.

    0 讨论(0)
  • 2021-01-14 03:27

    From here:

    (...) web pages designed specifically for the iPhone should reduce the size of each component to 25 Kbytes or less for optimal caching behavior.

    So, the obvious thing to do here is to "break down" your scripts and styles into multiple files of less than 25KB. You'd have to host them yourself then, obviously.

    0 讨论(0)
提交回复
热议问题