4D & Safari. Passing Data back & forth?

So, i’ve got my (first) web page sending a field value to 4D for processing. Now I want 4D to hand the $0 value back to Safari… but I don’t know how to do that.

My webpage function is as follows:


$all = “/4DACTION/GetName/” + $this.value
var xhttp = new XMLHttpRequest();
xhttp.open(“GET”, $all, false);

Product :4D - 4D Server
OS : Mac OS X

I do know the xhttp routine above has a facility of waiting for a response… I just don’t know how to provide one to it :frowning:

Or, there may be a better/simpler way of reaching my desired outcome?


You’ll need to implement a JS function to call on completion see “onreadystatechange” for async ajax call. Don’t be tempted to do a synchronous call. It will work but isn’t recommended.


To save your sanity, I recommend adding JQuery. It helps out with this and many other things and it’s freeee. https://jquery.com/

To send back your text based response from 4D, I believe you’ll need to use WEB SEND TEXT, WEB SEND BLOB or WEB SEND FILE.