dataType: “json” won't work

前端 未结 7 1469
面向向阳花
面向向阳花 2020-12-10 16:19

I\'m trying to send back multiple variables from a php file to ajax using json in an array. The code in the php file works perfectly and does everything with my database lik

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 17:06

    Common issue is that browser prints "something else" before JSON whether that is some readable or unreadable(invisible) char. Try doing something like this:

     $realid, "un" => $username, "date" => $date));
    ?>
    

    Now, all supplement data (before JSON) will be discarded and you should have it working...

提交回复
热议问题