• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Beginning XML with DOM and Ajax: From Novice to Professional

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AJAX can be used in javascript to return text output (used to inject html and javascript dynamically in a page).Text output can be used to return data also, and regular expresssion can extract the required data. We could even use JSON to construct a java script object from a servlet and return it. Now this can be evaled and javascript object is created at runtime. Thus we have many different ways of doing this. Then What is the advantage of returning xml output through AJAX ?
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AJAX, is Asynchronous Javascript and XML, it is a web technique for creating interactive web applications.
It uses the XMLHttpRequest Object exchange data asynchronously with the server.
XML is sometimes used as a format, but other formats such as preformatted HTML, plain text and JSON can be used...
 
Author
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I'm not sure I understand your post so let me double check to see that I've got it. Are you asking why we might use XML within Ajax instead of plain text?

If that's the question, my response would be that many applications already return XML content so Ajax can harness that directly. For example, Web services return content using XML vocabularies so we can proxy the data server-side and consume it with Ajax. We can also return some database calls directly in XML content rather than plain text.

XML also gives us a much more structured approach to data than plain text. We can include information about hierarchies within the data and use tags to describe the content. It's often quite difficult to describe array data using plain text.

A final point is that XML allows us to take advantage of predefined vocabularies. These might be specific to an industry and allow Web and desktop applications to consume the same content.

I hope that helps and that I've correctly interpreted your question.

Cheers

Sas Jacobs
 
reply
    Bookmark Topic Watch Topic
  • New Topic