title: Passing key names to json object in jquery
body: <p>I'm trying to write a generalised function that validates my field through Jquery Ajax. My problem is, I want to give key names via function input. However in the field_value variable, my field_label parameter stays as "field_label". I want to change it like "email", "username" so i can generate different jsons. So any idea ? </p>
  
  <pre><code>  function validate_field(span_id,field_id,field_label,url){
             var message_field = $("#" + span_id)
  
             $("#" + field_id).keyup(function(){
                  if(this.value != this.lastValue){
                        if(this.timer){
                            clearTimeout(this.Timer);
                        }
                  message_field.html('&lt;img src="/media/img/loader.gif"&gt;');
                  var field_value = {field_label : $("#"+field_id).val()};
                  var json_response = JSON.stringify(field_value);
                  this.timer = setTimeout(function(){
                        $.ajax({
                              type:'POST',
                              url:url,
                              contentType:'application/json; charset=utf-8',
                              data:json_response,
                              success:function(msg){
                                   message_field.html(msg);
                              }
                        });
                  });
               }
            });
      }
  </code></pre>