{ "id": "153023", "key": "TIMOB-20053", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2015-11-23T16:03:08.000+0000", "created": "2015-11-12T12:40:21.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "16919", "description": "Critical updates", "name": "Release 4.1.1", "archived": true, "released": true, "releaseDate": "2015-07-15" } ], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2015-11-23T16:03:08.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "Hi guys,\r\nI'm trying to parse simple JSON object loaded from web. On iOS it's working fine. On Android, I have to use eval('('+this.responseText+')'). But on Windows phone, JSON.parse does nothing(when I can choose JSON methods, parse method is only for mobile weband windows logo is grayed ) and eval() crash the app(without any error log). \r\nCan somebody please help me? \r\nThank you.", "attachment": [], "flagged": false, "summary": "JSON.parse not implemented on Windows Phone?", "creator": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "subtasks": [], "reporter": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "environment": "Win 8.1, AppcStudio 4.3.3, Ti SDK 5.0.1 GA", "comment": { "comments": [ { "id": "370087", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "I tried to pack JSON.parse into try/catch and it gives me error:\r\nSyntaxError: JSON Parse error: Unrecognized token '?'\r\nThe JSON itself is valid, I tried to parse it via console in browsers, even question mark ? is not present in that text.\r\nThank you", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2015-11-12T14:05:13.000+0000", "updated": "2015-11-12T14:05:13.000+0000" }, { "id": "370094", "author": { "name": "thebrousse", "key": "thebrousse", "displayName": "Christian Brousseau", "active": true, "timeZone": "Europe/Berlin" }, "body": "Why do you have to use \"eval\" on Android specifically?\r\n\r\nIf you can't even parse it without a hitch on Android, then there must be something _fishy _with your JSON data.\r\n\r\nCould you add the data to the ticket? That would give everyone a better understanding of your issue.", "updateAuthor": { "name": "thebrousse", "key": "thebrousse", "displayName": "Christian Brousseau", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-11-12T16:31:57.000+0000", "updated": "2015-11-12T16:32:43.000+0000" }, { "id": "370148", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi Christian,\r\nthis is my JSON output from web:\r\n\r\n{code:java}\r\n[{\"title\":\"Výkopové práce v Humennom\",\"perex\":\"V posledných týždňoch sa na mnohých miestach v Humennom realizovali aj stále realizujú výkopové práce, Park mieru nevynímajúc. Viacerí Humenčania sa zaujímali, čo je v tomto prípade vlastne za tým. Tu je objasnenie.\",\"article_id\":\"6\",\"created\":\"28.9.2015\",\"file\":\"http:\\/\\/edu.mkreo.sk\\/img\\/article\\/app\\/vykopove-prace-v-humennom-14.jpg\"},{\"title\":\"Škola vo Sv. Antone bude mať rýchly internet, stavbu siete dnes kontroloval minister\",\"perex\":\"Už len niekoľko desiatok metrov výkopu delí pracovníkov od školy vo Svätom Antone, aby ju pripojili prostredníctvom optickej siete na vysokorýchlostný internet.\",\"article_id\":\"5\",\"created\":\"11.9.2015\",\"file\":\"http:\\/\\/edu.mkreo.sk\\/img\\/article\\/app\\/skola-vo-sv-antone-bude-mat-rychly-internet-stavbu-siete-dnes-kontroloval-minister-10.jpg\"},{\"title\":\"Projekt „Digitálne učivo na dosah“ zvýši kvalitu výučby na 200 školách v regiónoch Slovenska\",\"perex\":\"Prístup k digitálnemu učivu garantovanou rýchlosťou, bezplatný technický servis aj zvýšenú bezpečnosť – to všetko prinesie do 200 škôl projekt „Digitálne učivo na dosah“.\",\"article_id\":\"4\",\"created\":\"25.2.2015\",\"file\":\"http:\\/\\/edu.mkreo.sk\\/img\\/article\\/app\\/projekt-digitalne-ucivo-na-dosah-zvysi-kvalitu-vyucby-na-200-skolach-v-regionoch-slovenska-9.jpg\"}]\r\n{code}\r\nAccording to jsonlint.com validator it's valid JSON, on iOS JSON.parse hasn't any problem to parse it.\r\nOn Android I have to use eval(), because of Android implementation of JSON methods(I read about it on Appcelerator's old Q&A, it's working normally). On Windows Phone, eval() cause application crash and JSON.parse throws common error ad can't parse it. If I set the first object of this json to variable as string, hyperlink is not escaped and it's parsed successfully(so for me is JSON.parse working partially) but if I read it from web via HTTPClient, it throws error.\r\nThank you.\r\n\r\nP.S: question marks added to that JSON are added by text formatter in this JIRA, it's in Slovak language with diacritics", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2015-11-12T23:00:15.000+0000", "updated": "2015-11-12T23:06:00.000+0000" }, { "id": "370200", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi guys,\r\nI discovered, that at start of my JSON string, there is a blank space and this cause JSON.parse to throw error. After I removed that, everything works fine. \r\nThank you", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2015-11-13T13:39:00.000+0000", "updated": "2015-11-13T13:39:00.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }