jquery ajax data shows [object Object]

前端 未结 3 522
旧时难觅i
旧时难觅i 2020-12-15 04:28

I have a very basic ajax call to alert the data that was reported from the server

$.ajax({
       type: \"POST\",
       url: \"/someform/act\", //edit utl t         


        
3条回答
  •  遥遥无期
    2020-12-15 05:01

    alert() prints the string representation of the arguments - hence if you pass an object, you'll get [object Object].

    To inspect data, use console.log(data) better.

提交回复
热议问题