我有一个按钮:
<button type="submit" id="subscribe_button" class="btn btn-danger btn-large" data-loading-text="loading stuff...">Subscribe</button>
我正在尝试从表单验证脚本“加载状态”中创建此按钮:
submitHandler: function(form) {
// do other stuff for a valid form
$('#results').append('<img src="loading.gif">')
$('#subscribe_button').button('loading')
$.post('forms.php', $("#subscribe").serialize(), function(data) {
$('#results').html(data);
$(document).ready(function() {
$("#cg1").removeClass('success').removeClass('error')
$('#email').val('');
});
});
一切正常,直到我添加以下行:
$('#subscribe_button').button('loading')
哪里可能是问题?