AJAX works on localhost, but doesn't on live server

前端 未结 6 1247
滥情空心
滥情空心 2021-01-28 08:32

Below code works on localhost, but not on live server.

MAIN EDIT:

Only 1 thing remains which is not working:

<
6条回答
  •  孤独总比滥情好
    2021-01-28 09:18

    Is your PHP code valid and not throwing extra code which is messing up your JSON object. When there is a notice the JSON object becomes a string instead of a JSON string and then javascript can't parse it anymore.

    Please make a new clean controller without any other code, post the data again and then check what is happening. Never return data but echo data with an exit.

    Javascript and Code looks valid but somewhere else in your MVC may throw HTML code in the exit statement or generating it before you enter the controller which is required to return the data.

提交回复
热议问题