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.
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.