I can't get past this.
I have a synapse http server. The client side sends a request, the app (server) creates an html which is saved to the outputdata stream that is sent back to the client.
This updates the <body> on the client side.
As long as I am on the same client html page everything works fine.
But for one client request I need to open a a new page. And here I get stuck.
Previously I add this script to the client <body>
var xhr = new XMLHttpRequest;
xhr.onreadystatechange=function(){
if (xhr.readyState === 4 && xhr.status ===200) {
(normally, document.body.insertAdjacentHTML("beforeend", xhr.responseText);');
what should I do here for this different purpose?
}
}
xhr.open("POST","http://192.168.1.64",true);
xhr.setRequestHeader("Content-Type", "text/xml");
xhr.send();
Normally I have this in the request processing on the server side
l:=loadheadings(t);
l.SaveToStream(OutputData);
..... set all appropriate headers and send them
Sock.SendBuffer(OutputData.Memory, OutputData.Size);
The page gets updated according to the L (which is html markup).
But i I want to load a new page loaded with this L, and open it, what should I do? Perhaps save L to a disk file in the server side?
What should go in the xhr.onreadystatechange=function() and
what should I return after loadheadings() on the server side?