最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

出現(xiàn)錯(cuò)誤:Uncaught SyntaxError: JSON.parse: JSON 數(shù)據(jù)第 3

出現(xiàn)錯(cuò)誤:Uncaught SyntaxError: JSON.parse: JSON 數(shù)據(jù)第 3

對(duì)于以下代碼獲取輸出$response=array();    $response['wheel_deg_end'] = (360*(ceil($wheel->wheel_spin_time/3))) + (360 - (($wheel_slice_number * 30) - 30)) + rand(-5,5);$response['wheel_time_end'] = $wheel->wheel_spin_time * 1000;$response['success'] = true;                    $ab = json_encode($response,JSON_NUMERIC_CHECK);echo $ab;輸出:"{"wheel_deg_end":1743,"wheel_time_end":10000,"success":true}"Json 解析錯(cuò)誤:jQuery.ajax({    url: couponspining_ajaxurl,    type: 'POST',    data: {        action: 'couponspining_wheel_run',        form_data: form_data,        preview_key: this.preview_key    },    context: this,}).done(function(json){    this.submit_form_done(jQuery.parseJSON(json));});未捕獲的語(yǔ)法錯(cuò)誤:JSON.parse:JSON數(shù)據(jù)submit_form的第3行第1列出現(xiàn)意外字符 http://localhost/shopify-php-app/src/public/assets/js/couponspining1.js:210
查看完整描述

3 回答

?
慕萊塢森

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

只需將解析 json 行從

this.submit_form_done(jQuery.parseJSON(json));

this.submit_form_done(json);

因?yàn)槿绻?AJAX 調(diào)用的配置具有 dataType: json,您將獲得一個(gè) JavaScript 對(duì)象,因此不再需要使用 JSON.parse()。


查看完整回答
反對(duì) 回復(fù) 2023-11-02
?
陪伴而非守候

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超8個(gè)贊

"{"wheel_deg_end":1743,"wheel_time_end":10000,"success":true}"不是有效的 json 字符串。

哪個(gè)應(yīng)該是{"wheel_deg_end":1743,"wheel_time_end":10000,"success":true}


查看完整回答
反對(duì) 回復(fù) 2023-11-02
?
料青山看我應(yīng)如是

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超8個(gè)贊

將內(nèi)容類(lèi)型設(shè)置為 json:


jQuery.ajax({

  url: couponspining_ajaxurl,

  type: "POST",

  contentType: "application/json",

  data: {

    action: "couponspining_wheel_run",

    form_data: form_data,

    preview_key: this.preview_key

  },

  context: this

}).done(function(json) {

  this.submit_form_done(jQuery.parseJSON(json));

});


查看完整回答
反對(duì) 回復(fù) 2023-11-02
  • 3 回答
  • 0 關(guān)注
  • 206 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)