use the message returned by $.ajax function
$.ajax({
type: "post",
url: "test.jsp",
data: "user=" + name.val(),
success: functio开发者_StackOverflow中文版n(msg) {
$('#result').hide();
$("#result").html(msg).fadeIn("slow");
if (msg == "available") {
//want to disaply image
alert('message: ' + msg); } } });
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
//want to disaply image
$('#myImage').show();
If the image doesn't show up, you might want to add an alert
alert('message: ' + msg);
精彩评论