jquery ajax returning true but not display proper message?
<p>I have the following code</p>

<pre><code>$(document).ready(function(){
// class exists
if($('.delete').length) {
        // add click handler
    $('.delete').click(function(){
        // ask for confirmation
        var result = confirm('Are you sure you want to delete this?');
        var vid     = $(this).attr('id'); 
        var row = $(this).parents('tr');  
        // do ajax request
        if(result) {
            $.ajax({
                type:"POST",
                url:"delete_joke.php",
                data:{id:vid,garbage:'FG9g543hfh'},
                dataType: "json",
                success:function(response){

                    // hide table row on success
                    if(response == "true") {
                        row.fadeOut();
                       $('#errors').show();
                        $('#errors').html( '&lt;div class="message green"&gt; Successfully deleted!&lt;img src="http://puppetweb.ca/play/views/admin/gfx/icon-close.gif" alt="Close this item" /&gt; &lt;/div&gt;' ).show();

                    }else{
                       $('#errors').show();
                        $('#errors').html( '&lt;div class="message red"&gt; Error deleting. &lt;img src="http://puppetweb.ca/play/views/admin/gfx/icon-close.gif" alt="Close this item" /&gt; &lt;/div&gt;' ).show();

                    }
                }
            });
        }
    return false;
    });
}
});
</code></pre>

<p>And it works up until the part where I want to show the success, I have the php script print "true" on success and "false" on error, and if I do alert(response) it shows the word true. But it is displaying the Error deleting on success and Error deleting on error?</p>

<p>Any help?</p>
