私はいくつかのjqueryスクリプトにロードgifを追加しようとしています。私は前に働いていたthis pluginを使うかもしれないと思ったが、私はフォームを提出するときにそれがなぜ発射されないのかを考えようとしている。私は正しい場所に持っていますか?jqueryローダーが動作しないのはなぜですか?
<script>
$(document).ready(function() {
$('#post_data').submit(function() {
//I've placed the plugin here
$('#spinner').pleaseWait();
$.ajax({
url: 'process.php',
type: 'POST',
dataType: 'html',
data: $(this).serialize(),
success: function(newContent) {
$('#mytable').prepend('<tr>' + newContent + '</tr>');
$("form").trigger("reset");
}
});
return false;
});
});
divが表示されたい場所。
<div class="center-block" id="spinner"></div>
コンソールにエラーがありますか?プラグインが正しくロードされていますか?あなたは "post_data"と呼ばれる有効なフォームを持っていますか? –