If have a html form like
<form method="POST" action="http://.../file.php">
<input type="text" name="data" id="data" />
<input type="submit" />
</form>
I want to make a ajax-request with jQuery, but I don't want to use an invisible form to submit this. But somehow I don't get it to work. My try was
$.ajax({
type: "POST",
url: "http://.../file.php",
data: d,
success: function(msg){
alert( "Data Saved: " + msg );
}
});
were d
contains a JSON object which I would just paste in the above form field as plaintext. The success function gets executed, but I don't get the answer from the server (which means that something must go wrong :-)