douci2022
douci2022
2013-07-26 06:56

Sencha Touch 2.x [WARN] [Ext.data.reader.Reader #process]找不到JSON对象

已采纳

i am trying to get data from mysql as json to a nested list in Sencha Touch. Only Problem is i get this Error and dont know why:

[WARN][Ext.data.reader.Reader#process] Unable to parse the JSON returned by the server:

Error: You're trying to decode an invalid JSON String: data=[ "name":rezepte{"id":"1","name":null,"alter":"Ab 6.Monat","kategorie":null,"tageszeit":"Mittags","portionen":"1 baby- und 1 Erwachsenenportion","bild":"\u0000\u0000\u0000\u0000\u0000","vorrat":"2", "zubereitungszeit":"45","zubereitung0":null,"zubereitung1":null,"zubereitung2":null,"info":null}]

[WARN][Ext.data.reader.Reader#process] JSON object not found

fields containing utf-8 signs appear as null. DB is utf-8_general so i thought it might be the way the json returned looks. switch around but didnt work.

Please let me know what you need to help me.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongpang4470 dongpang4470 8年前

    Your JSON is invalid or your server responding with invalid JSON.

    It should be like this

    {
       "name":"rezepte",   
          "id":"1",
          "name":null,
          "alter":"Ab 6.Monat",
          "kategorie":null,
          "tageszeit":"Mittags",
          "portionen":"1 baby- und 1 Erwachsenenportion",
          "bild":"\u0000\u0000\u0000\u0000\u0000",
          "vorrat":"2",
          "zubereitungszeit":"45",
          "zubereitung0":null,
          "zubereitung1":null,
          "zubereitung2":null,
          "info":null
     }
    
    点赞 评论 复制链接分享