动态加载Ajax数据

I have a bunch of jQuery functions which gets JSON data from a MySQL database and displays it on certain pages within my application.

i have about 15 of these functions that look similar to the below and i would like to tidy them up and convert them to one major function which returns data based on the variables passed to the function. IE getdata(subscriptions) would display the subscriptions.

My issue is i'm not sure how to pass the column names to the function from the ajax query and remove the value.column-name from the function.

Example function from application

function GetSubscriptions(){    
    $.ajax({
    url: 'jsondata.php', 
    type: 'POST',       
    dataType:'json',
    timeout:9000,                       
    success: function (response)                
    {           
      var trHTML = '';    
      $.each(response, function (key,value) {
         trHTML += 
            '<tr><td>' + value+ 
            '</td><td>' + value.subscription_name + 
            '</td><td>' + value.subscription_cycle +    
            '</td><td>' + value.subscription_cost +     
            '</td><td>' + value.subscription_retail +   
            '</td><td>' + value.subscription_profit +   
            '</td><td>' + value.subscription_margin + 
            '</td><td>' + value.subscription_markup +                               
            '</td></tr>';                   
      });
        $('#subscription-results').html(trHTML);
    },          
  });   
}

Any help is very much appreciated as i'm fairly new to jQuery

You can refer to this code:

function GetSubscriptions(){    
  $.ajax({
      url: 'jsondata.php', 
      type: 'POST',       
      dataType:'json',
      timeout:9000,                       
      success: function (response)                
      {               
          $('#subscription-results').html(parseColumns(response));
      },          
  });
}   
function parseColumns(columns) {
    var html = '';

    if (Object.prototype.toString.apply(columns) === '[object Array]') {
        $.each(columns, function(key, value) {
            html += parseColumn(value);
        })
    } else {
        html += parseColumn(columns);
    }

    function parseColumn(column) {
        var trHTML = '<tr><td>' + column + '</td>';

        for (var key in column) {
           trHTML += '<td>' + column[key] + '</td>'
        }
        trHTML += '</tr>';

        return trHTML;
    }

    return html;
}