I copied a correct JSON string (JSON validators say its correct), but when using JSON.parse it throws an Unexpected token error....
a='{"geoip_allowed":true,"image":"//im.stream.cz/episode/55095485275cc222d4890300/{width}/{height}","product_placement":null,"sponsor":{"collocation":"Web","section":"/jidlo-s-r-o","zone_id":"streamcz.self.sponzor.poradu","options":""},"logo":"//www.stream.cz/static/img/logo.png?6695b96","duration":860,"seen":false,"id":10005186,"web_mregg_section":"/jidlo-s-r-o","url_name":"hovezi-maso-2-starene-maso-a-steaky","_embedded":{"stream:show":{"url_name":"jidlo-s-r-o","name":"Jídlo s.r.o.","shop_link":"http://ift.tt/1APceLM","shop_link_text":"Pořad Jídlo s.r.o. na Facebooku ZDE","image":"//im.stream.cz/images/53691eb7de96815a75620100/{width}/{height}","_links":{"self":{"profile":"show","href":"/show/jidlo-s-r-o"},"stream:backward":{"href":"/show/jidlo-s-r-o?direction=backward"},"stream:forward":{"href":"/show/jidlo-s-r-o?direction=forward"}},"poster_image":"//im.stream.cz/static/img/default_poster.png","shop_link_image":"//im.stream.cz/shop-images/54f648cbd7489dfb4e010000","disable_comments":0,"id":10000325,"channel":0},"stream:season":{"order":2,"url_name":"epizody","_links":{"self":{"href":"/season/2722"}},"id":2722,"name":"Epizody"},"stream:recommended":{"_embedded":{"stream:episode":[{"url_name":"sunka-4-malovyroba","_embedded":{"stream:show":{"url_name":"jidlo-s-r-o","_links":{"self":{"profile":"show","href":"/show/jidlo-s-r-o"}},"name":"Jídlo s.r.o.","channel":0}},"name":"Šunka (4) – Malovýroba ","timeline":null,"image":"//im.stream.cz/episode/5369f74872e52cba521f0000/{width}/{height}","_links":{"self":{"href":"/episode/10002196"},"stream:show":{"href":"/show/jidlo-s-r-o"}},"published":null,"seen":false,"id":10002196},{"url_name":"mleko-a-mlecne-vyrobky-6-biofarma","_embedded":{"stream:show":{"url_name":"jidlo-s-r-o","_links":{"self":{"profile":"show","href":"/show/jidlo-s-r-o"}},"name":"Jídlo s.r.o.","channel":0}},"name":"Mléko a mléčné výrobky (6) - Biofarma","timeline":null,"image":"//im.stream.cz/episode/546c73aa723d02493e330200/{width}/{height}","_links":{"self":{"href":"/episode/10004179"},"stream:show":{"href":"/show/jidlo-s-r-o"}},"published":null,"seen":false,"id":10004179},{"url_name":"hovezi-pupek","_embedded":{"stream:show":{"url_name":"menudomu","_links":{"self":{"profile":"show","href":"/show/menudomu"}},"name":"MENU domů","channel":0}},"name":"Hovězí pupek","timeline":null,"image":"//im.stream.cz/episode/5272760b8a91592a328f0200/{width}/{height}","_links":{"self":{"href":"/episode/10000104"},"stream:show":{"href":"/show/menudomu"}},"published":null,"seen":false,"id":10000104}]},"_links":{"self":{"href":"/episode/10005186/recommended"},"stream:episode":[{"href":"/episode/10002196"},{"href":"/episode/10004179"},{"href":"/episode/10000104"}]}}},"web_site":null,"detail":"Už jste někdy slyšeli pojem tzv. <b>stařené maso</b>? Je to trend, jeho průkopníkem je u nás společnost <b>Amaso, s.r.o.</b>, kde si vybírají konkrétní kusy dobytka přímo u chovatelů, dohlíží na stravu, zacházení se zvířetem i na porážku. Maso\r\n si tu bourají, a především - <b>nechávají ho odležet a vyzrát</b>. Navíc učí kuchaře z restaurací proměnit odleželé kvalitní maso ve vynikající jídlo. I my si tedy ukážeme, jak se z nejlepšího masa porcují ty nejlepší steaky, jaké druhy steaků existují a jakých 10 zásadních pravidel dodržovat, abychom na talíř připravili perfektní gastronomický zážitek. <br><br><span lang=\"cs\"><b>OHODNOŤTE TENTO POŘAD NA ČSFD <a href=\"http://ift.tt/1APceLT\">ZDE</a></b>.<br><b><br>FACEBOOK POŘADU JÍDLO S.R.O. NAJDETE</b> <a href=\"http://ift.tt/1APceLM\"><b>ZDE</b>.</a><br><font color=\"#666666\"><br><span lang=\"cs\">Účinkovali: Vlasta Lacina Jaroš, Zdeněk Marcín, Roman Vaněk<br>Režie: Martin Krušina<br>Střih: Vláďa Šimek<br>Kamera: Janek Rubeš, Markus Krug<br>Grafický design: Lukáš Veverka<br></span><br><span lang=\"cs\">Dramaturg: Martin Krušina<br>Produkce: Zdenka Weisová, Lucka Dřízhalová<br>Šéfproducent: Lukáš Záhoř<br><br>© 2015 Seznam.cz, a.s. </span></font></span><br>","canonical_url":"http://ift.tt/1DF9M0m","live":false,"_links":{"stream:hit_rss":{"href":"/hit/rss?episode_id=10005186"},"stream:season":{"href":"/season/2722"},"curies":[{"href":"http://ift.tt/1DF9NkU","name":"stream","templated":true}],"self":{"href":"/episode/10005186"},"stream:following_episodes":{"href":"/show/jidlo-s-r-o?direction={direction}&after_episode_order=36&after_episode_season_order=2","templated":true},"stream:hit_subtitles":{"href":"/hit/subtitles?episode_id=10005186"},"stream:recommended":{"href":"/episode/10005186/recommended"},"stream:following_favourites":{"href":"/timeline/favourites?timestamp_from=1426659300&episode_id=10005186"},"stream:hit_view":{"href":"/hit/video_view?episode_id=10005186"},"stream:show":{"href":"/show/jidlo-s-r-o"},"stream:next_playlist":{"href":"/timeline/latest?timestamp_from=1426659300&episode_id=10005186"}},"subtitles_srt":"//im.stream.cz/subtitles/55091a82048474ecd0620000","mregg":[{"zone_id":"streamcz.self.videospot.all","section":"/jidlo-s-r-o","aspect_ratio":1.7777,"skippable_after":5,"collocation":"Web","position":0,"options":""}],"web_site_text":null,"views":196472,"timeline":1426659300,"video_qualities":[{"quality_label":"","formats":[{"quality":"240p","type":"video/mp4","source":"http://ift.tt/1APcg6s"},{"quality":"240p","type":"video/webm","source":"http://ift.tt/1APcgmN"}]},{"quality_label":"Nízká","formats":[{"quality":"360p","type":"video/mp4","source":"http://ift.tt/1DF9M0v"},{"quality":"360p","type":"video/webm","source":"http://ift.tt/1DF9M0x"}]},{"quality_label":"Střední","formats":[{"quality":"480p","type":"video/mp4","source":"http://ift.tt/1APcgDp"},{"quality":"480p","type":"video/webm","source":"http://ift.tt/1DF9Nl2"}]},{"quality_label":"Vysoká","formats":[{"quality":"720p","type":"video/mp4","source":"http://ift.tt/1APcgTK"},{"quality":"720p","type":"video/webm","source":"http://ift.tt/1DF9M0B"}]},{"quality_label":"Full HD","formats":[{"quality":"1080p","type":"video/mp4","source":"http://ift.tt/1APcfiT"},{"quality":"1080p","type":"video/webm","source":"http://ift.tt/1DF9Nl7"}]}],"subtitles":"//im.stream.cz/subtitles-json/55091a82961dec90717d0000","ident":null,"mregg_inject":[{"right":1,"zone_id":"streamcz.self.injektaz","bottom":0.300135,"color":["dark"],"section":"/jidlo-s-r-o","time_from":27,"collocation":"Web","time_to":35,"top":0,"left":0.75}],"name":"Hovězí maso (2) - Stařené maso a steaky","transition_time":null,"mregg_before":true,"published":1426659300,"aspect_ratio":1.778,"mregg_after":true,"order":36}'
JSON.parse(a); // throws an error
Aucun commentaire:
Enregistrer un commentaire