Hello,
PHP programmer in need of some js help. I can't seem to get this
function to return the value of xmlhttp.responseText.
alert(xmlhttp.responseText) 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("GET", url)
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
return(xmlhttp.responseText);
}
}
xmlhttp.send(null);
}
This was taken from:
http://www.webpronews.com/webdevelop...POnTheFly.html
Thanks!