Javascript: how to map a var to a function under jquery? (Resolved)
<p>I'm tweaking an existing open source tool...</p>

<p>Its current js code has the following line, that opens up a new window
to dump output, and the user takes an action or not.</p>

<pre><code>var win = window.open(...);
</code></pre>

<p>What I'd like to do is to redirect the
var win ... part
so that it would send the {data} via a FORM element and let a web
server script to process it,</p>

<p>My following attempt failed without error</p>

<pre><code>// var data is known

// page that calls/includes the js code has a FORM with a field
// named 'workspace'

win = function() 
{
  document.forms[0].getElementById('workspace').value='+data+';
  document.forms[0].action = "serverSideScript2processData";
  document.forms[0].method = "post";
  document.forms[0].submit();

}
</code></pre>

<p>Also, the current javascript uses jquery.</p>

<p>How to do it?</p>

<p>Thanks. </p>
