Hello I would like to slightly modify the below script so that it outputs the response to a div rather than a alert see bold section. Any help appreciated!
function processResponse() {
if (gateway.readyState == 4 && gateway.status == 200) {
alert("Done loading!
The response from the PHP script was: "+gateway.responseText);
}
}
if the div has an id try something like this:
document.getElementById("divId").innerHTML = gateway.responseText;
function processResponse() {
if (gateway.readyState == 4 && gateway.status == 200) {
document.getElementById("yourDiv").innerHTML = "php script was : " + gateway.responseText;
}
}
or if using jquery
function processResponse() {
if (gateway.readyState == 4 && gateway.status == 200) {
$("#youdivid").html("php script was : " + gateway.responseText);
}
}