I'm doing an AJAX request to submit a form:
<form id="ajax-contact" role="form" action="signup.php" method="post">
And for javascript something like this:
$(function() {
// Get the form.
var form = $('#ajax-contact');
...
$.ajax({
type: 'POST',
url: $(form).attr('action'),
data: formData
}).done(function(response)
...
}).fail(function(data) {
...
});
});
Using the Chrome inspect element I see that this message after submitting:
Error: POST http://localhost:9000/signup.php 404 (Not Found)
However, if I click on the link in the error message it downloads the correct signup.php, so I know the file exists at that location.
Any idea of what I'm doing wrong?