| | |
responseText format??
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 147
Reputation:
Solved Threads: 10
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.
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.
Thanks & Regards,
Anuj Sharma
Future Software Engineer
Anuj Sharma
Future Software Engineer
0
#2 Nov 3rd, 2009
Without 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
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
if (responseText == "no"){ //do something}else{//do something else}
Life... Is a Moment
0
#4 Nov 3rd, 2009
Your 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
To see what is actually served, try :-
(where x contains the response text).
Airshow
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 :-
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
alert(x.length); //it is the length you expect? //-- or alert(escape(x)); //then manually decode the result.
Airshow
50% of the solution lies in accurately describing the problem!
![]() |
Similar Threads
- Need to make responsetext elements navigable with HREF (JavaScript / DHTML / AJAX)
- HDD format ntfs or fat? (Storage)
- Format a Partition (C)
- i just installed a 120 gig harddrive and need help to format the drive (Windows NT / 2000 / XP)
- 40 gig western digital permanent format in NTFS? (Storage)
- Format Backup Drives with NTFS (Windows tips 'n' tweaks)
- exporting iMovie Document to Vcd format (Mac Software)
- Convert a Flash page to PDF format? (Graphics and Multimedia)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: change link border
- Next Thread: Textbox validate
Views: 527 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxcode ajaxexample ajaxjspservlets api blackjack browser bug calendar captchaformproblem checkbox child class close cookies createrange() cursor dependent disablefirebug dom dropdown editor element embed engine events explorer ext file firehose flash form forms game gears google gxt hiddenvalue highlightedword hint html ie8 iframe image() images internet java javascript javascripthelp2020 jquery jsf jsfile jump libcurl margin math matrixcaptcha media mp3 mysql object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post progressbar rated regex runtime scroll search security session shopping size software solutions sql star stars stretch synchronous text textarea tweet unicode web webkit window windowsxp wysiwyg xspf \n





