开发者

Unable to select page contents through class in jQueryMobile

开发者 https://www.devze.com 2023-03-11 04:17 出处:网络
I\'m unable to select page contents through class in jQueryMobile.开发者_如何学JAVA $(\'div[data-role=\"content\"]\'); works fine

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');
0

精彩评论

暂无评论...
验证码 换一张
取 消