Monday, 9 September 2013

Parsing JSON Data and show in HTML web page

Parsing JSON Data and show in HTML web page

I have HTML web page i want to show the JSON Data in it i am using
following code but it does not show any thing on page. I am getting Data
JSON USING URL which is also listed in code .
<HTML>
<HEAD>
<script>
$("document").ready(function() {
$.getJSON("http://www.celeritas-solutions.com/pah_brd_v1/productivo/getGroups.php?organizationCode=att&userId1",
function(data) {
$("#div-my-table").text("<table>");
$.each(data, function(i, item) {
$("#div-my-table").append("<tr><td>" + item.EncoderName
+"</td><td>" + item.EncoderStatus + "</td></tr>");
});
$("#div-my-table").append("</table>");
});
});
</script>
</HEAD>
<BODY>
<table id="div-my-table">
</table>
</BODY>
</HTML>

No comments:

Post a Comment