gpt4 book ai didi

javascript - 错误 SyntaxError : JSON. 解析:JSON 数据后出现意外的非空白字符

转载 作者:行者123 更新时间:2023-11-30 08:03:41 24 4
gpt4 key购买 nike

<分区>

我收到错误:SyntaxError: JSON.parse: JSON 数据后出现意外的非空白字符

我的代码:

<script>
$(document).ready(function () {
$('.edit1').on('change', function () {
arr = $(this).attr('class').split(" ");
var clientid = document.getElementById("client").value;
account_id = document.getElementById("account_id").value;
$(this).parent().next().find('input:checkbox').attr("checked", true);
$.ajax({
type: "POST",
url: "clientnetworkpricelist/routestatusupdate.php",
data: "value=" + $(this).val() + "&rowid=" + arr[2] + "&field=" + arr[1] + "&clientid=" + clientid + "&account_id=" + account_id,
success: function (result) {
data = jQuery.parseJSON(result); //added line

var obj = data;

$('#CPH_GridView1_Status' + arr[2]).empty();
$('#CPH_GridView1_Status' + arr[2]).append(data.status);

$('.ajax').html($(this).val());
$('.ajax').removeClass('ajax');
}
});
}
);
});
</script>

JSON 输出:

{"status":"<img  src=\"image\/Equalf.png\" \/>","seleniumrouteupdate":"1","routeupdate":"100"}{"status":"<img  src=\"image\/Equalf.png\" \/>","seleniumrouteupdate":"1","routeupdate":"100"}{"status":"<img  src=\"image\/Equalf.png\" \/>","seleniumrouteupdate":"1","routeupdate":"100"}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com