This is the code, you must change the format of datatype to HTML to get the data, or error 200 will be error. $.ajax ({
type:"POST", async:false, url:"
generateURL('Film.Index', array('save'));?>", data:dataparam, dataType:"json", success:function(msg){
Reply content:
This is the code, you must change the format of datatype to HTML to get the data, or error 200 will be error. $.ajax ({
type:"POST", async:false, url:"
generateURL('Film.Index', array('save'));?>", data:dataparam, dataType:"json", success:function(msg){
Set header on server, no output before header
header('Content-type: application/json');
Data assembled on the service side
echo json_encode($var);
This is caused by your service side not returning your expected JSON format, you print out the service-side output to see.
That is the data returned by the server is not a JSON format, not a front-end issue.