Jump to content

Passing PHP return values to Javascript


jnroche

Recommended Posts

Hi Guys!Im trying to pass a return value from PHP file to a javascript source code and the javascript source code would look like this:in AJAX: ...xmlhttprequest('reasons', '../templates/Emailto.php');I want Emailto.php to return something and I know I can catch this value from the ajax responseText property, so with this is it correct to say:...document.getElementById('spanIDhere').innerHTML = xmlhttp.responseText; if (xmlhttp.responseText == "something") {process here;}...i tried this to no avail. How can i let javascript/ajax know what the responseText is to process it further within the same file if i cant catch responseText as a javascript/ajax ordinary variable? :) ?????????

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...