问题
I'm trying to update my JQM app from 1.3 to 1.4, and on some element, data-enhance="false" doesn't work anymore… The elements remains enhanced…
jsfiddle : http://jsfiddle.net/matthieubrunet/RB9Qw/
<div data-role="page" id="home">
<div data-role="header">
<h1>JQM 1.4.3</h1>
</div>
<div data-role="content">
<label for="yes">Yes</label>
<input type="checkbox" name="yes" id="yes" data-enhance="false" />
</div>
</div>
I tried to activate the ignoreContentEnabled option, but it doesn't work :
$( document ).on( "mobileinit", function() {
$.mobile.ignoreContentEnabled = true;
});
Is it a bug, or am I missing something ?
Thanks a lot for your help.
回答1:
put your script
$( document ).on( "mobileinit", function() {
$.mobile.ignoreContentEnabled = true;
});
just before loading jquery mobile js. official docs state that mobileinit gets called as soon as jquery mobile js gets loaded : http://api.jquerymobile.com/global-config/
Therefor the order should be:
jquery.js -> mobileinit binding script-> jquery.mobile.js
来源:https://stackoverflow.com/questions/24608502/jquery-mobile-1-4-data-enhance-false-dont-work