SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2007
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    json unexpected token

    Hi hope someone could shed some light here, I have been debugging this for ages but can't find the solution. I have not encountered any problem with latest IE9, firefox and chrome, but some of my customers using a "china" browser have this issue.

    Invalid JSON:

    {"output":"<p>\u8bf7\u9009\u62e9\u4e00\u4e2a\u8d27\u8fd0\u65b9\u5f0f.<\/p>\n<table class=\"form\">\n <tr>\n <td style=\"width: 1px;\"> <input type=\"radio\" name=\"shipping_method\" value=\"flat.flat\" id=\"flat.flat\" checked=\"checked\" \/>\n <\/td>\n <td><label for=\"flat.flat\">\u5feb\u9012 EMS<\/label><\/td>\n <td style=\"text-align: right;\"><label for=\"flat.flat\"><\/label><\/td>\n <\/tr>\n <tr>\n <td style=\"width: 1px;\"> <input type=\"radio\" name=\"shipping_method\" value=\"item.item\" id=\"item.item\" \/>\n <\/td>\n <td><label for=\"item.item\">\u6302\u53f7\u7a7a\u90ae<\/label><\/td>\n <td style=\"text-align: right;\"><label for=\"item.item\"><\/label><\/td>\n <\/tr>\n <tr>\n <td style=\"width: 1px;\"> <input type=\"radio\" name=\"shipping_method\" value=\"free.free\" id=\"free.free\" \/>\n <\/td>\n <td><label for=\"free.free\">\u5ba2\u6237\u81ea\u53d6 \uff08\u4ec5\u63d0\u4f9b\u7ed9\u5c45\u4f4f\u65b0\u52a0\u5761\u6216\u66fc\u8c37\u7684\u5ba2\u6237\uff09<\/label><\/td>\n <td style=\"text-align: right;\"><label for=\"free.free\"><\/label><\/td>\n <\/tr>\n <\/table>\n<b>\u6dfb\u52a0\u8ba2\u5355\u5907\u6ce8<\/b>\n<textarea name=\"comment\" rows=\"8\" style=\"width: 98%;\"><\/textarea>\n<br \/>\n<br \/>\n<div class=\"buttons\">\n <div class=\"right\"><a id=\"button-shipping\" class=\"button\"><span>\u7ee7\u7eed<\/span><\/a><\/div>\n<\/div>\n"}

    Anyone have any idea? I've tried to validate this json output and it says Valid in Javascript but invalid acording to RFC blah blah..
    I Dunno LOL \(_o)/

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,061
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    The JSON is fine (according to http://jsonlint.com/).
    I don't know if that is good or not.

    Here's a good thread on StackOverflow which might give you some ideas for how to debug this: http://stackoverflow.com/questions/3...expected-token

    Would be interested to find out what was wrong if you get to the bottom of it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •