title: how to send JavaScript variable through ajax
body: <p>I don't know how i can send two parameters ( l_id and l_title) through below method. I used a file upload plugin and want to send two parameters as well on php file.</p>
  
  <p>Please help me how i can assign my variables values in below code if use double or single quotes around the  variables like below it work but send static name as mentioned in quotes.</p>
  
  <pre><code> formData: { id: "l_id", title: "l_title"},
  </code></pre>
  
  <p>but i want to send dynamic values of variables to php file so i need to use below code that making issue.</p>
  
  <pre><code> formData: { id: l_id, title: l_title},
  </code></pre>
  
  <p>Below is full code of jquery</p>
  
  <pre><code>  &lt;script&gt;
              $(document).ready(function()
              {
              $(window).load(function(){
              var l_id = $("#id").val();
              var l_title = $("#title").val();
              });
              var settings = {
  
                  url: "ajax_upload.php",
                  method: "POST",
                  allowedTypes:"jpg,png,gif,pdf",
                  formData: { id: l_id, title: l_title},
                  fileName: "imageSource",
                  multiple: true,
                  onSuccess:function(files,data,xhr)
                  {
                      $("#status").html(data);
                      },
                      afterUploadAll:function()
                      {
                              alert("all images uploaded!!");
                      },
                  onError: function(files,status,errMsg)
                  {        
                      $("#status").html("&lt;font color='red'&gt;Upload is Failed&lt;/font&gt;");
                  }
              }
              $("#mulitplefileuploader").uploadFile(settings);
  
              });
          &lt;/script&gt;
  </code></pre>