0

我目前resp在警报中显示。

我怎样才能在我spanclass错误中显示它?

代码:

if(resp == '')
        {

        }else{
            alert(resp);
        }
    },
4

4 回答 4

1
if(resp == '')
        {

        }else{
                                //!!!! set your response --                                     
           $("span.error").html(resp);
//here select span ^^^^ with class error
        }
    },
于 2013-10-30T05:34:52.540 回答
0
if(resp == '')
        {
           // Do whatever your want
        }else{
            $('.errorspan').text(resp);
        }
    }
于 2013-10-30T05:37:20.927 回答
0
if(resp != null && resp != ''){
    var span = document.createElement('span ');
    span .className = 'error';
    span .innerHTML = resp ;
    document.getElementById('parentDivId').appendChild(span);

}
于 2013-10-30T05:34:56.663 回答
0

试试这个代码

if(resp == '')
{//some code.
}else{
    $(".error").text(resp);
}
于 2013-10-30T05:36:00.190 回答