title: JQuery ajax data option "key" value cannot be created from a passed variable, how can I do this?
body: <p>The following works perfectly until I try to replace the hard coded "service_id" with the passed string variable id_name.</p>
  
  <p>Is there a way to pass a variable into this part of the options?, If so, how be it?</p>
  
  <p>Working version:</p>
  
  <pre><code>function deleteRecord(id)
  {
  $.ajax({
    'url': url_root+'admin/index',
    'type': 'POST',
    'data': {"service_id" : id,
            'ajax_name': 'services_list_table'
            },
    'dataType': 'json',
    'success': function(data)
          {
              $("#ajax_services_table").html(data.html);
          }
      });
  }
  </code></pre>
  
  <p>Not working version (passing in the "service_id" as a variable)</p>
  
  <pre><code>function deleteRecord(id,id_name)
  {
      $.ajax({
        'url': url_root+'admin/index',
        'type': 'POST',
        'data': {id_name : id,
                'ajax_name': 'services_list_table'
                },
        'dataType': 'json',
        'success': function(data)
              {
                  $("#ajax_services_table").html(data.html);
              }
      });
  }
  </code></pre>