Ik heb hier een Jquery scriptje waarmee ik een POST doe naar een .php bestand. Ik wil een return doen na het Jquery script om aan te geven of hij wel of niet success is (of via If...Else) Hoe kan ik dit doen?
var x = <? echo $row['locationx']; ?>;
var y = <? echo $row['locationy']; ?>;
function wentdown(){
y = y + 20;
$.ajax({
url: 'check_move.php',
type: 'POST',
data: 'xcor=' + x + '&ycor=' + y,
success:
function( feedback ) {
$('#poppetje').animate({ "top" : y + 'px' }, 500);
}
});
}
en in checkmove moet zo iets komen:
<?php
if($_POST['xcor'] == $blabla AND $_POST['ycor'] == $blabla2)
{
return true;
}
else
{
return false;
}
?>