Web サイトのすべてを div 内にロードしたいので、フォーム送信を処理してアクションを同じ div にロードする関数を作成しましたが、問題はaction=""
、スクリプトが同じページにあるため、一部のフォームにアクションがないことです、フォームを送信してもdiv内では何も起こらないので、関数でこれを処理するにはどうすればよいですか?
$(document).ready(function() {
$('#mydiv').delegate('form', 'submit', function() { // catch the form's submit events inside the div
$.ajax({ // create an AJAX call...
data: $(this).serialize(), // get the form data
type: $(this).attr('method'), // GET or POST
url: $(this).attr('action'), // the file to call
success: function(response) { // on success..
//$('#mydiv').html(response); // update the DIV
$('#mydiv').fadeOut('slow',function() {
$('#collabsoft').html(response).fadeIn('slow');
});
// return false;
}
});