I am very new and only just learning Jquery. I am currently submitting data from a form and on success it refreshes the div so that it updates.
I know there is a problem with my data sending Jquery code but I’ve never had to send data.
Can someone tell me what I should use here:
function secure()
{
$.ajax({
type: "POST",
url: "secure.php",
async: false,
data: "username="+$("#username")"password="+$("#password").val(),
success: function(msg){
$("#auth").html(msg);
}
});
}
You forgot a
.val(), a+, and a&.Or just use the
serialize()[docs] method.…assuming you have the name attributes set on your form elements.