I need to build a list using the parameters "name" taken from my file "sendjson.php" (in json, of course). How can i create a list using jQuery like this one?
<div id="firstresultname">Firstresultname</div>
<div id="secondresultname">Secondresultname</div>
I don't know how much result will be so is possible to detect and write th开发者_如何学JAVAe right number on div? Thanks!
$.each(json, function(key, value){
    $("body").append('<div id="'+value+'">'+value+'</div>');
});
or just
$.each(json, function(key, value){
    $("body").append('<div>'+value+'</div>');
});
to retreive json & proccess, do following
$.ajax({
    'url' : 'yoururl.php',
    dataType: 'json',
    success: function(json){
        $.each(json, function(key, value){
            $("body").append('<div>'+value+'</div>');
        });
    }
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论