views:

169

answers:

2

Working with JSON is quite new to me, yet I already like it. But i'm facing an annoying issue. Here's how things work: jquery makes an Ajax request for a specific url, this url is a STRUTS action, and, on success, returns a specific jsp this jsp includes JSON taglib (http://www.atg.com/taglibs/json) in order to render proper JSON formatting.

Shaping communications beetween client and server gives me this : alt text

As you can see, http headers seem fine, yet, my JSON contains hex. characters, such as '

The problem is, I'm using part of the JSON answer to output html using Jquery; I'm facing this problem creating tooltips on the fly, each and every time the ajax request is made.

Maybe my javascript code isn't made to deal well with the JSON input , so heres a bit of my code to handle this JSON answer :

var toolTip = $("<span/>").addClass("tooltip").text(article.description).hide().appendTo(rowDescriptionArticle);

As you can see, I quite basically retrieve description for each article node, and insert it using text() into my span.

Any idea what going wrong ?

+1  A: 
Christopher
Thanks, you rock !
pixelboy
A: 

Here's what my JSON looks like :

{"totalPanier":"0,00","articles":[{"id":"8a8b8d632481567f01248156fac90009","reference":"CART01","prixAffiche":"0,00","quantite":"0","libelle":"Carte CADEAUX Ã  montant variable","montantRemise":"","prixTotal":"00,00","visuel":"/documentsArticles/2009/14131/0005/209141310005_dim1.jpg","description":"Carte Cadeaux d&#039;une valeur de 15 Ã  150 euros."},{"id":"8a8b8d632481567f0124815706910010","reference":"CART80","prixAffiche":"80,00","quantite":"0","libelle":"Carte CADEAUX 80 Euros","montantRemise":"","prixTotal":"00,00","visuel":"/documentsArticles/2009/14131/0004/209141310004_dim1.jpg","description":"Carte Cadeaux d&#039;une valeur de 80 Euros."},{"id":"8a8b8d632481567f012481570578000f","reference":"CART50","prixAffiche":"50,00","quantite":"0","libelle":"Carte CADEAUX 50 Euros","montantRemise":"","prixTotal":"00,00","visuel":"/documentsArticles/2009/14131/0003/209141310003_dim1.jpg","description":"Carte Cadeaux d&#039;une valeur de 50 Euros."},{"id":"8a8b8d632481567f012481570549000e","reference":"CART30","prixAffiche":"30,00","quantite":"0","libelle":"Carte CADEAUX 30 Euros","montantRemise":"","prixTotal":"00,00","visuel":"/documentsArticles/2009/14131/0002/209141310002_dim1.jpg","description":"Carte Cadeaux d&#039;une valeur de 30 Euros."},{"id":"8a8b8d632481567f012481570364000d","reference":"CART15","prixAffiche":"15,00","quantite":"0","libelle":"Carte CADEAUX 15 Euros","montantRemise":"","prixTotal":"00,00","visuel":"/documentsArticles/2009/14131/0001/209141310001_dim1.jpg","description":"Carte Cadeaux d&#039;une valeur de 15 euros."}]}

Sorry for missing formating, yet I believe you'll be able to decode it a bit...

pixelboy
Normally you should edit your question at the top to add data like this (as you already have with the jQuery snippet). So you can delete this answer of yours if you like. I've updated my answer based on the new info :)
Christopher
sorry, i'm brand new to stackoverflow, gotta learn how it works a bit...
pixelboy