Using jQuery to get json data returns invalid label error

后端 未结 5 965
借酒劲吻你
借酒劲吻你 2020-12-17 21:44

I have this code, and have also tried something similar using the $.getJson function:

jQuery(document).ready(function(){
    var kiva_url = \"http://api.kiva         


        
5条回答
  •  孤城傲影
    2020-12-17 22:16

    Where does the error occur? Does error occur when you try to loop through the ajax data and append it to the inner_div? If yes, please show us what the data.loans look like.

    Also, there is a typo in your code:

                jQuery.each(data.loans, function(i, loan){
                        jQuery("#inner_div").append(loan.name + "
    "); //It should be loan.name and not laon.name }); },

提交回复
热议问题