I am trying to create a ajax-login-form, but my jquery-script cant find the php file. they are in the same directory (!), but it doesn't work.
my php-file (logreg.php)
<?php
echo 'true';
?>
my script-file (logreg.js)
$("button[action=\"register\"]").click(function(){
var username = $("#login-username").val();
var password = $("#login-password").val();
var repassword = $("#login-repassword").val();
$.ajax({
type: "POST",
url: "logreg.php",
data: "name="+username+"&pass="+password+"&repass="+repassword,
success:function(html){
if(html=='true'){
}
},
beforeSend:function(){
$("button[action=\"register\"]").text("Sendet ...");
},
error: function(ts) { $("div#content").html(ts.responseText); }
});
});
why isnt this working? i am getting everytime "Error 404" (not found).