Getting two pieces of data from an Ajax response

mekmike

New Member
When process.php responds to an Ajax request made by form.html it replies with "false" or "true [hash value]" (where hash value is the output of a hashing function). In form.html I want to call a different function for the two possible responses but how do I parse the response? For example must I call
\[code\]var responses = xmlhttp.responseText.split(" ")\[/code\]
Assuming the hashing function never outputs "false" I could use
\[code\]if(xmlhttp.responseText != "false")\[/code\]
Both these ways seem kind of hacky and inefficent, is there a better way?
 
Back
Top