[jQuery] Check if callback is empty

[jQuery] Check if callback is empty


hi all,
In PHP i have:
if ($data = get_order_by_id($order_id))
{
    echo    json_encode($data);
    return TRUE;
} else {
    return FALSE;
}
Jquery:
$.post("/od/get_order/",
    {order_no: order_no},    
        function(order){
            $("#name").html(order.name);
            $("#address").html(order.address);
            $("#zipcode").html(order.zipcode);
        
        }, 'json');
So if the $order_id in PHP does not exist, the function returns FALSE.
In this case, it like to throw an error on de client
Something like
$("#zipcode").html('Order does not exist');
But where would i place this piece of code?
--
View this message in context: http://www.nabble.com/Check-if-callback-is-empty-tp17775622s27240p17775622.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.