jquery ajax 200,javascript - jQuery AJAX 200 status, yet mysterious syntax error - Stack Overflow

I have a status 200 being returned when I'm using jQuery AJAX. However, I am also getting a syntax error from somewhere. I am posting to PHP like this:

function submit_order(orderInformation) {

$.ajax({

type: 'post',

url: 'queries/submit_order.php?=time();?>',

data: 'orderInformation=' + JSON.stringify(orderInformation),

dataType: 'json',

success: function (returnedData) {

console.log(returnedData);

$('#content_container').fadeOut(340, function () {

var new_content = $('#content_container').clone(false);

$('#content_container').remove();

new_content.css('display', 'none');

new_content.children().remove();

new_content.appendTo('body');

$('#content_container').vkTemplate('templates/confirm_template.tmpl?=time()?>', returnedData, function (el, data, context) {

console.log('success');

$('#content_container').fadeIn(340);

});

});

},

error: function (xhr, ajaxOptions, thrownError) {

console.log(xhr.status);

console.log(thrownError);

}

});

}

My PHP code is pretty straightforward:

$order_information = json_decode($json_str, true);

//go through the array and make an email out of it

//add a few elements to the array

//send the email

//send back a json string with the added elements

echo json_encode($order_information);

Yet I get this:

sP7l7.png

And oddly, if I copy paste the JSON string from console.log(JSON.stringify(orderInformation)) into the PHP page:

$json_str = '{"sector_0":{"file":[],"sector_info":{"sector_label":"NIO","purchase_order":"test","proof":false},"lines":{"line_0":{"description":"test","quantity":"2","productId":"1","addressId":"20","shipViaId":"1","notes":false}}}} ';

everything works. What is this error? Where could this < seen in the error be coming from?

Thanks

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值