title: Jquery param alternative for javascript
body: <p>I need to convert following type dictionary:</p>
  
  <pre><code>{'key1': ['value1'], 'key2': ['value1', 'value2']}
  </code></pre>
  
  <p>to <code>key1=value1&amp;key2=....</code></p>
  
  <p>i.e. post data form. I am doing this inside chrome extention, the above dictionary of formdata is returned by:</p>
  
  <pre><code>chrome.webRequest.onBeforeRequest.addListener(function(details) {
        if(details.method=="POST")         // ajax call
        {
          message.postdata = details.requestBody.formData;
        }
        return {requestHeaders: details.requestHeaders};
   }, {urls: ["&lt;all_urls&gt;"],types: ["main_frame", "sub_frame"]}, ["blocking", "requestBody"]);
  </code></pre>
  
  <p>I remeber achieving the same using <strong>JQuery $.params()</strong> function. How can the same be done in javascript.</p>