Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

request: optional markup enhancements #2665

spellfork opened this Issue Oct 11, 2011 · 3 comments


None yet
3 participants

First off, jqm is awsome in so many ways and after some extensive testing performancewise I've found that performance can be boosted alot simply by limiting the javascript enhancement of markup. What I mean is that instead of processing each and every tag and data-attribute in order to get the nice jqm look I simply do much of the markup myself in my html document.

In order to get this to work with many elements I've been modifying the jqm script quite alot, and I'd really wish there was a way (like using data-role="none") to disable markup enhancments but still be able to hook on events that listen to clicks etc without having to mess around in the core js file.

This would be very nice for form elements such as the radio buttons controlgroup as well as for the on/off switch.

I made a final performance test yesterday, I made two test pages containing every possible element from the jqm docs, one with no enhancement markups and one with the markup allready applied. For the 'vanilla' page I simply used the jquery mobile rc1 compressed script and for the pre-enhanced I used my own heavilly modified. the difference was about 1.5 seconds in load time on an iPhone 4. Every resource was loaded from the server and the both used the same css ( took about 5 seconds for the pre-enhanced and about 6.5 for the non-enhanced file over a 3G mobile connection).

I'll admit that the test page was not replicating any real world scenarios with so many elements, but there clearly is a significant speedup of page rendering if you disable the markup enhancements through the js.

The drawback is that you end up with much larger html documents (mine was 19KB - non-enhanced and 36KB - pre-enhanced). And even though reducing the data might be perferable in many cases I think the option to allow for pre-enhanced pages might be good when speed and load times are a big issue.


toddparker commented Oct 11, 2011

This is a really good idea. We've been thinking that for slower browsers (like BB5), generating the enhanced markup on the server would be much easier on the processor and this may be a good tradeoff vs. bandwidth if you care more about performance.

Adding this would obviously touch all our plugins quite deeply so we won't be able to look at this until after 1.0. Could you add a link to this issue to the feature request wiki page here, then close this issue. We'll re-open once we can tackle this.

Hi Todd and thank you for the quick response :)
I've created a new wiki page with the link to this issue... now closing.

@spellfork spellfork closed this Oct 12, 2011

@spellfork & @toddparker - Have you put any more thought into this? The feature request on the wiki has languished: https://github.com/jquery/jquery-mobile/wiki/request:-optional-markup-enhancements

I'm considering writing a component where the server generates enhanced markup as you've described. If you've already tried this, or have an idea what it means to build components that support both JS-enhanced and server-side markup, I'd love to know before I try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment