How to map a function to a var?

D

DL

Hi,

I'm tweaking an existing open source tool...

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.
var win = window.open(...);

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 the web
server to process it,

My following attempt failed without error
// var data is known

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

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

win = function sendForm();

Also, the current javascript uses jquery.

How to do it?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top