How would I go about doing this?

后端 未结 3 1432
既然无缘
既然无缘 2021-01-29 12:18

First I have my data encoded in the json_encode function.

Looks like this for example:

{\"test\":\"test value\"}

What I want to do is m

3条回答
  •  执笔经年
    2021-01-29 12:51

    $.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'); });

    straight from the jquery docs...

提交回复
热议问题