Jquery ajax and php die()

Posted by BizMark on Stack Overflow See other posts from Stack Overflow or by BizMark
Published on 2010-05-14T02:42:26Z Indexed on 2010/05/14 3:04 UTC
Read the original article Hit count: 153

Filed under:
|
|

Hi, I have an IE problem. I am using the jquery ajax method to call a php script. The php script just calls die(). In firefox, the error message is displayed, but in IE the success message is displayed without any data. I would prefer the error function to be called.

Is there any way to fix this? I'm guessing my javascript code needs change somehow.

Thanks!

<?php
    die()
?>

$.ajax({
    url: "phps/php.php?id="+the_id,
    dataType: "json",
    error: function(){
        alert('error');
    },
    success: function(data){
        alert("SUCCESS");
    }
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX