Should I use XML or text, JavaScript, or HTML as a return type?

Answer

It depends. Clearly the 'X' in AJAX stands for XML, but several AJAX proponents are quick to point out that
nothing in AJAX, per se, precludes using other types of payload, such as, JavaScript, HTML, or plain text.
* XML - Web Services and AJAX seem made for one another. You can use client-side API's for downloading and
parsing the XML content from RESTful Web Services. (However be mindful with some SOAP based Web
Services architectures the payloads can get quite large and complex, and therefore may be inappropriate with
AJAX techniqes.)
* Plain Text - In this case server-generated text may be injected into a document or evaluated by client-side
logic.
* JavaScript - This is an extension to the plain text case with the exception that a server-side component passes
a fragment of JavaScript including JavaScript object declarations. Using the JavaScript eval() function you can
then create the objects on the client. JavaScript Object Notation (JSON), which is a JavaScript object based data
exchange specification, relies on this technique.

All ajax Questions

Ask your interview questions on ajax

Write Your comment or Questions if you want the answers on ajax from ajax Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---