Hey Guys,
I am using JSP with AJAX. After a certain JSP script is processed the output is sent to the responseText. Now, I want to check what output responseText consists so that i can perform further processing. For eg, I want responseText to contain"yes" or "no" and depending on what it contains i want to execute client side script. I hope i have nt confuse you.
anuj_sharma
-3
Junior Poster
Recommended Answers
Jump to PostWithout being able to see your code, all i can say is that u can do a comparison on the value returned by responseText, something like
if (responseText == "no"){ //do something}else{//do something else}
Jump to PostYour JSP may be serving something more than just "Yes"/"No".
Something as small as a rogue linefeed will cause a test for "Yes" or "No" aways to fail and hence drop through to the
else
clause.To see what is actually served, try :-
All 5 Replies
Thirusha
20
Posting Whiz
anuj_sharma
-3
Junior Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
anuj_sharma
-3
Junior Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.