Hello,
PHP programmer in need of some js help. I can't seem to get this
function to return the value of xmlhttp.respons eText.
alert(xmlhttp.r esponseText) gives me the value I'm looking for. I
assume this has to do scope... but don't quite get how to get the return
value in the `= function()` syntax.
function phj_func(url) {
xmlhttp.open("G ET", url)
xmlhttp.onready statechange = function() {
if (xmlhttp.readyS tate == 4 && xmlhttp.status == 200) {
return(xmlhttp. responseText);
}
}
xmlhttp.send(nu ll);
}
This was taken from:
Thanks!
PHP programmer in need of some js help. I can't seem to get this
function to return the value of xmlhttp.respons eText.
alert(xmlhttp.r esponseText) gives me the value I'm looking for. I
assume this has to do scope... but don't quite get how to get the return
value in the `= function()` syntax.
function phj_func(url) {
xmlhttp.open("G ET", url)
xmlhttp.onready statechange = function() {
if (xmlhttp.readyS tate == 4 && xmlhttp.status == 200) {
return(xmlhttp. responseText);
}
}
xmlhttp.send(nu ll);
}
This was taken from:
Thanks!
Comment