I am returning Json data from a controller's action.
On the client, I am using jQuery templates where I bind data as follows:
var result = $("#jobsTmpl").tmpl(results.data);
$("#jobsContainer").empty().append(result);
The data returned from server contains P
tags, I noticed that they are being displayed as encoded html tags.
How could I decode the data returned?
I am placing JavaScript in an external file so I won't be able to use @HTML.Raw() helper.
Thanks
I used this, however when checking on the page, I noticed the HTML is something as:
"
Consequat te olim letalis premo ad hos olim odio olim indoles ut venio iusto. Euismod, sagaciter diam neque antehabeo blandit, jumentum transverbero luptatum. Lenis vel diam praemitto molis usitas camur, nostrud eros opes verto epulae feugiat ad. Suscipit modo magna letalis amet et tego accumsan facilisi, meus. Vindico luptatum blandit ulciscor mos caecus praesent sed meus velit si quis lobortis praemitto, uxor.
"Notice the double quotes! Still, < p > tags are showing as tags and not being executed!
this is the Json being returned:
{"data":
[
{
"Title":"Need a Website?",
"Body":"\u003cp\u003eConsequat te olim letalis premo ad hos olim odio olim indoles ut ve \u003c/p\u003e"
}
]
}