jquery:-[object Object] error

后端 未结 4 982
难免孤独
难免孤独 2021-01-11 10:44

i have a validation.js file

var name = $(\"#name\");

    $.ajax({
        type:       \"get\",
        url:        \"test.jsp\",
        data:           \"n         


        
4条回答
  •  终归单人心
    2021-01-11 11:39

    looks like msg isn't what you expect. I think you want msg.responseText

    The reason you see [object Object] is because msg is of type object and you pass it into .html which will convert it to a string. And thus the html is filled with the string representation of object which in this case is "[object Object]"

提交回复
热议问题