use the message returned by $.ajax function
<pre><code>$.ajax({
    type: "post",
    url: "test.jsp",
    data: "user=" + name.val(),
    success: function(msg) {

        $('#result').hide();

        $("#result").html(msg).fadeIn("slow");

        if (msg == "available") {
            //want to disaply image
</code></pre>

<p>alert('message: ' + msg);
            }
        }
    });</p>

<p>i want to display available and a image with a tick mark to indicate correctness,but the above code is not working
alert is not working</p>
