Unable to select page contents through class in jQueryMobile
I'm unable to select page contents through class in jQueryMobile.开发者_如何学JAVA
$('div[data-role="content"]');
works fine
$('div.ui-content');
only selects a few
jQuery Mobile adds the class when it enhances the page. You might be calling the selector before the enhancement is done (I won't guess no more, it's your app ;) )
the correct way to get all the content nodes is:
$("div:jqmData(role='content')")
You should omit the blank, not
$('div .ui-content');
but
$('div.ui-content');
精彩评论