On Mon, 17 Oct 2011, Felipe Monteiro de Carvalho wrote:

Hello,

I am trying to send data from javascript and read data back from my
cgi module with this:

 SendSyncRequest = function(RequestURL, RequestContent)
 {
   var request = new XMLHttpRequest();
   request.open('GET', RequestURL, false);
   request.setRequestHeader('Content-Type', 'text/html');
   request.send(RequestContent);
   //debugDiv.innerHTML = debugDiv.innerHTML + "after send<br>";
   return request.responseText;

As far as I know, this will always be empty, for the simple reason that the request is executed asynchronously. You must attach a callback which is executed once the request is ready, and read ResponseText after that.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to