title: send an object that contains variables to a function
body: <p>What I'm trying to is this. I have a function <code>chart (params){ }</code> in a javascript file. Params are not just a variable but an object containing other variables. I want to store variables in this object (<em>params</em>) from an html file and then call the function. </p>
  
  <p>I think the code will look something like this, although I haven't managed to make it work.</p>
  
  <pre><code>var params = new object();
  
  params.type = 'bar';
  
  ...
  
  carts (params);
  </code></pre>