I have a problem that drives me crazy at the moment. Via JQuery I request a JSON document from the server, which is not accepted (the error is "unexpected character"). However my JSON document seems just fine, in Firebug i.e. the JSON data is correctly detected and parsed.
If I copy the response and try to validate it via jsonlint.com it always fails on the first character ([
). If I change some characters and copy stuff around but leaving the result the same it then validates (try for example copying the contents of []
and then erase them and write them again, paste the content again and you have the same document but it now validates). Strange. So I thought it may be related to the encoding, but firefox clearly states that everything is UTF8 encoded.
Now I'm kind of clueless what do to and I hope you can help me in any way.
Here is the JSON reponse of my server:
[
{
"id": 67,
"startdate": "01.01.1970 01:00:00",
"hometeam": "EHC Muskrats",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 69,
"startdate": "01.01.1970 01:00:00",
"hometeam": "EC Mammuts",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 70,
"startdate": "01.01.1970 01:00:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EC Mammuts"
} , {
"id": 86,
"startdate": "01.01.1970 01:00:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EC Mammuts"
} , {
"id": 4,
"startdate": "08.10.2012 21:00:00",
"hometeam": "Wiener Teifl",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 18,
"startdate": "28.10.2012 21:00:00",
"hometeam": "EC Heizbären",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 19,
"startdate": "04.11.2012 18:00:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "Innviertel Penguins"
} , {
"id": 6,
"startdate": "15.11.2012 21:00:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EC Heizbären"
} , {
"id": 62,
"startdate": "17.11.2012 19:30:00",
"hometeam": "EC V.U. Totonka",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 12,
"startdate": "22.11.2012 20:30:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EHC Muskrats"
} , {
"id": 13,
"startdate": "27.11.2012 19:30:00",
"hometeam": "TÜV Cannibals",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 7,
"startdate": "02.12.2012 17:00:00",
"hometeam": "Fire Fighters jun.",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 63,
"startdate": "03.12.2012 19:00:00",
"hometeam": "",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 8,
"startdate": "09.12.2012 17:00:00",
"hometeam": "EHC Vienna Flames",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 14,
"startdate": "17.12.2012 20:15:00",
"hometeam": "EC Mammuts",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 15,
"startdate": "07.01.2013 20:15:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EC Mammuts"
} , {
"id": 9,
"startdate": "10.01.2013 20:00:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EHC Chiefs"
} , {
"id": 11,
"startdate": "19.01.2013 21:00:00",
"hometeam": "EC Attacki",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 16,
"startdate": "24.01.2013 20:30:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "TÜV Cannibals"
} , {
"id": 10,
"startdate": "28.01.2013 19:30:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EC V.U. Totonka"
} , {
"id": 17,
"startdate": "30.01.2013 20:30:00",
"hometeam": "EHC Muskrats",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 65,
"startdate": "24.02.2013 21:00:00",
"hometeam": "EC Heizbären",
"awayteam": "EHC Vienna Wookies"
} , {
"id": 66,
"startdate": "28.02.2013 20:40:00",
"hometeam": "EHC Vienna Wookies",
"awayteam": "EHC Chiefs"
} , {
"id": 64,
"startdate": "08.03.2013 21:00:00",
"hometeam": "EHC Vienna Flames",
"awayteam": "EHC Vienna Wookies"
} ]