1
我正在使用jquery mobile 1.3.2,每當我按下按鈕,按鈕顯示被按下的樣式,但它不會再次回來。jquery移動按鈕不會彈出
HTML:
<form id="login_form">
<input type="text" name="username">
<input type="password" name="password">
<button type="submit" data-theme="b" data-role="submit">Login</button>
</form>
的Javascript:
$("#login_form").submit(function()
{
$.mobile.allowCrossDomainPages = true;
var options = {
url:API_SERVER_URL+"/login",
type: "post",
success: function(data)
{
if (data.success)
{
$.mobile.changePage('success.html', {transition: "slide"});
}else
{
alert("failed:(");
}
},
error: function()
{
alert('cannot connect');
}
};
options = $.extend(DEFAULT_AJAX_OPTIONS, options);
$(this).ajaxSubmit(options);
return false;
});
我認爲這種行爲將是自動的。還是因爲這是一個提交事件? –
@JonathanChow提交按鈕不像錨點按鈕一樣工作,這就是爲什麼你需要手動刪除類。 http://jsfiddle.net/Palestinian/G3DbA/ – Omar
感謝清理:) –