| | |
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: 511 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array automatically autoplay beta blackjack boarder box button captcha card cart codes column css date debugger decimal design developer dom download element embed enter error events firefox flash focus form frameworks gears getselection google gwt hiddenvalue hint html htmlform ie7 iframe index java javascript javascripthelp2020 javascripts jquery jsp libcurl listbox maps marquee masterpage media menu microsoft mimic mp4 offline onerror onmouseover parameters paypal php player position post problem programming prototype rating redirect safari scale scriptlets search security select size software sources starrating toggle tweet twitter unicode validation variables w3c web webkit webservice website window windowofwords xml





