I'm calling a Web Service method to get some html data. When I set the returned data as innerHtml for a div tag then it is displayed as-is (literal text). I don't want my returned html data to be encoded. How to do this?
Here is my JQuery code:
$(document).ready(function () {
$("#btnGetLaboratories").click(function () {
var oService = new LaboratoryService();
var fResult = oService.send(); // returns some html data
$("#divResult").html(fResult);
});
});
Here is my html code:
<input id="btnGetLaboratories" type="button" value="Get Laboratories" />
<div id="divResult">
</div>
fResulton the rendered page? Could you show an example of data it returns and how it looks on the page? It's not very clear what the problem is.<b>hello</b>, then my div (i.e., divResult) innerHtml becomes<b>hello</b>; This is not what I'm expecting. I expect that a hello to be rendered on page.