Jquery unidentified data return when post
- by Nhat Tuan
<?php //load.php
$myid = $_POST['id'];
if($myid == 1){
    echo '1';
}else if($myid == 0){
    echo '0';
}
?>
<html>
    <input id="id" />
    <div id="result"></div>
    <input type="button" id="submit" />
    <script type="text/javascript">
      $('#submit').click( function(){
        var send = 'id=' + $('#id').val();
        $.post('load.php', send, function(data){
            if(data == 1){
                $('#result').html('Success');
            }else if(data == 0){
                $('#result').html('Failure');
            }else{
                $('#result').html('Unknow');
            }
        });
      });
    </script>
</html>
I test this script in some free host and it work but in my real host jquery unidentified data return and it alway show 'Unknow'.
When i change if(data == '1') it show 'Unknow' too
EX: input id = 1 click submit & data return is 'Unknow'
Why ?? I think this error from host, because i test it in some free host and it work, but now in my real host i got this error, how i can fix it ?