JSFiddle - React, Tailwind, and code Playground

by Akram kamal

HTML

<table id="result" border="1">
</table>

JavaScript

// http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_26788700.html
// but not working.

jQuery(document).ready( function () {

  getFirstList();

});

function getFirstList() {
  $.ajax({
    url: "http://jsfiddle.net/api/user/zalun/demo/list.json",
    dataType: "json",
    cache: false,
    success: getSecondList
  });
}

var fiddle;
function getSecondList( data ) {
  fiddle = data;
  $.ajax({
    url: "http://jsfiddle.net/api/user/kamicane/demo/list.json",
    dataType: "json",
    cache: false,
    success: render
  });
}

function render( data ) {
  fiddle = fiddle.concat( data );

  var index = -1;
  while ( ++index != fiddle.length ) {
    var row = $("<tr/>");
    if ( index == 0 ) {
      for ( var field in fiddle[index] ) {
        row.append( $("<td/>").text( field ) );
      }
      $("#result").append( row );
    }
    row = $("<tr/>");
    for ( var field in fiddle[index] ) {
      row.append( $("<td/>").text( fiddle[index][field] ) );
    }
    $("#result").append( row );
  }
}