j'essaye de récupérer du JSON et de le parser et j'ai une erreur.
Me renvoie en console d'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 tags = "{\"liste\":[{\"id\":10354691,\"label\":\"sceptique\"},{\"id\":10354692,\"label\":\"indifférent\"},{\"id\":10354693,\"label\":\"furieux\"},{\"id\":10354694,\"label\":\"satisfait\"},{\"id\":10354688,\"label\":\"je suis d'accord\"},{\"id\":10354689,\"label\":\"je ne suis pas d'accord\"},{\"id\":10354690,\"label\":\"je m'interroge\"}]}";//$.getJSON("http://localhost:8080/PortletAnnotation-1.0.0/ServletTag?type=tag"); jsonTags = eval(tags);
Et alors si je tente de récupérere ce JSON sur une ressource distante via jquery, là j'ai une autre erreur :invalid label
pour le code suivant :mal formé
Je vois pas en quoi mon json est mal formé...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 tags = $.getJSON("http://localhost:8080/PortletAnnotation-1.0.0/ServletTag?type=mood"); jsonTags = eval(tags);
http://localhost:8080/PortletAnnotat...tTag?type=mood me renvoie exactement : {"liste":[{"id":10354691,"label":"sceptique"},{"id":10354692,"label":"indifférent"},{"id":10354693,"label":"furieux"},{"id":10354694,"label":"satisfait"},{"id":10354688,"label":"je suis d'accord"},{"id":10354689,"label":"je ne suis pas d'accord"},{"id":10354690,"label":"je m'interroge"}]}
Partager