ajax - Jsp, Jquery and Json encoded characters issue -
working json quite new me, yet it. i'm facing annoying issue. here's how things work: jquery makes ajax request specific url, url struts action, and, on success, returns specific jsp jsp includes json taglib (http://www.atg.com/taglibs/json) in order render proper json formatting.
shaping communications beetween client , server gives me : alt text http://www.freeimagehosting.net/uploads/e4a91d6251.jpg
as can see, http headers seem fine, yet, json contains hex. characters, such '
the problem is, i'm using part of json answer output html using jquery; i'm facing problem creating tooltips on fly, each , every time ajax request made.
maybe javascript code isn't made deal json input , heres bit of code handle json answer :
var tooltip = $("<span/>").addclass("tooltip").text(article.description).hide().appendto(rowdescriptionarticle);
as can see, quite retrieve description each article node, , insert using text() span.
any idea going wrong ?
there's nothing abnormal json containing html entities — if that's part of string browser going display, sounds fine.
based on jquery snippet , json sample posted, looks — in non-jquery-using opinion — should setting html()
rather text()
of span, description
field html-encoded.
Comments
Post a Comment