| | |
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 28 Days Ago
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 28 Days Ago
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
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser bug calendar captchaformproblem cart close codes column cookies css date debugger decimal dependent design disablefirebug dom download element embed engine enter error events ext file firefox focus form frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 iframe index java javascript javascripthelp2020 jawascriptruntimeerror jquery jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 onmouseoutdivproblem onmouseover paypal pdf php player position post problem programming prototype redirect regex safari scale scriptlets scroll search security select software sql text textarea toggle unicode variables w3c website window windowofwords windowsxp





