weixin_33733810 2014-11-18 12:52 采纳率: 0%
浏览 21

意外令牌D

I understand this question has been asked many times but I am still not able to get the error. I am trying to parse text coming from server.

"MARUTI"
"MAHINDRA AND MAHINDRA"
"FIAT"

Every texts parsed except "MAHINDRA AND MAHINDRA". I do not understand where the problem is. here is my code.

var myObject = JSON.parse(httpxml.responseText);

Error in Console

Uncaught SyntaxError: Unexpected token D 

Please help.

  • 写回答

1条回答 默认 最新

  • weixin_33693070 2014-11-18 12:54
    关注

    Thats not a JSON String. You should inform about JSON

    http://en.wikipedia.org/wiki/JSON

    Return a JSON string from your server. With PHP you can use json_encode to encode an array to a json string.

    评论

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏