我在表单中有一个隐藏字段,我想用 ajax 处理,但它不起作用
formname = idke
hiddenfieldname = id
$(document).ready(function () {
$('.timeline_shout_buttons').click(function () {
$('#nodig').dialog({
width: 625,
height: 'auto',
buttons: {
Ok: function () {
$.ajax({
type: "POST",
url: "delete.php?id=document.getElementById(#id).value",
data: $("idke").serialize(), // serializes the form's elements.
success: function (data) {
alert(data); // show response from the php script.
}
});
return false; // avoid to execute the actual submit of the form.
}
}
});
});
});