couldn't display json multiple objects with jquery -
i new jquery. but, want json multiple objects append html element. here first jquery code:
<html> <head> <script type="text/javascript" src="jquery/jquery.js"></script> <script> $(document).ready(function(){ $.getjson("http://epomia.com/tmp/dc.php", function(data){ $.each(data, function(id, vall){ $.each(vall, function(x, y){ $("#mbuh").append(y); }); }); }); }); </script> </head> <body> <div id="mbuh"> </div> </body> </html>
but, why doesn't want display json data ? wrong ? json in http://epomia.com/tmp/dc.php or code ?
the json correct.
the json link provided object 4 properties each of array. don't have iterate through array in order append each element. can call
$.each(data, function (id, vall) { $("#mbuh").append(vall); });
see working fiddle
Comments
Post a Comment