Ben bu ajax jquery kodu vardır:
var form = document.getElementById('frm');
var data_string = form.serialize();
$.ajax({
type: "POST",
url: "my_php_file.php",
data: data_string,
success: function(data) {
}//end success function
}) //end ajax call
Bu ajax.js. adında harici bir dosyada olduğu
I include ajax.js into an html file called "show.html". I also include jquery.js into show.html
I have tried getting the serialize to work, but the code is terminated right before executing the serialize. I have no idea why. But I am sure that it is the serialize which is causing it.
Bu bazı kolay değişiklik yapmak için, bu yüzden serialize kullanmaz mümkün mü?
Teşekkürler
GÜNCELLEME:
This code (from answer below) seems to work partially also, when I alert the "form" variable, the message says "HTML Form Object" so it finds the form. Then when I alert the "data_string" variable, the message says "frm=undefined".
Herhangi bir fikir neden?
var form = document.getElementById('frm');
var data_string = $(form).serialize();