开发者

use the message returned by $.ajax function

开发者 https://www.devze.com 2023-02-09 11:19 出处:网络
$.ajax({ type: \"post\", url: \"test.jsp\", data: \"user=\" + name.val(), success: functio开发者_StackOverflow中文版n(msg) {
$.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);
0

精彩评论

暂无评论...
验证码 换一张
取 消