📜  getjson 是如何工作的? - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:36.698000             🧑  作者: Mango

代码示例3
$.getJSON( "ajax/test.json", function( data ) {
  var items = [];
  $.each( data, function( key, val ) {
    items.push( "
  • " + val + "
  • " ); }); $( "
      ", { "class": "my-new-list", html: items.join( "" ) }).appendTo( "body" ); });