Hi I am a complete noob in this. I am trying to call a simple php page from js script
$.ajax({
url: "././mail/testphp.php",
type: "POST",
dataType: "html",
success: function() {
// Success message
alert("success");
},
error: function(xhr,textStatus,err) {
alert("readyState: " + xhr.readyState + "\n" +
"responseText: " + xhr.responseText + "\n" +
"status: " + xhr.status + "\n" +
"text status: " + textStatus + "\n" +
"error: " + err);
},
})
This is the testphp:
<?php
echo 'Hello';
?>
The alert I am getting is "NetworkError: Failed to execute send on XMLHttpRequest failed to load file dir/testphp" (the directory is correct).
Both js and php are on my local hard drive. Do I need to put it on a server for it to work or something?
edit: here's the error I am getting (note: the directory IS correct)

././mail/testphp.phpand not../../mail/testphp.php?