After applying the
http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css and
http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js
the text of the button cannot be changed by scripting $(this).val('new value');
Do anyone have similar experience and have the solution?
DEMO can be tried from FIDDLE
JQUERY:
$(document).ready(function () {
$('#submit_btn').click(function (e) {
e.preventDefault();
$(this).val('Processing ...');
$.ajax({
cache: false,
type: "POST",
dataType: "json",
data: $('#form1').serialize(),
url: "echo/json",
complete: function (HttpRequest, textStatus) {
$(this).val('Create');
}
});
return false;
});
});
HTML:
<form action="call.php" method="POST" id="form1" name="form1">
<input type="text" name="campname" id="campname">
<textarea id="longdesc" name="longdesc"></textarea>
<input type="text" name="vercode" id="vercode" />
<input type="submit" value="Create" id="submit_btn" />
</form>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…