1 / 10

XML and AJAX

XML and AJAX. Dave Salinas. What is XML?. XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed to transport and store data XML tags are not predefined XML is designed to be self-descriptive

irving
Download Presentation

XML and AJAX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML and AJAX Dave Salinas

  2. What is XML? • XML stands for eXtensible Markup Language • Markup language, like HTML • HTML was designed to display data, whereas XML was designed to transport and store data • XML tags are not predefined • XML is designed to be self-descriptive • Can be stored as text files

  3. XML Syntax • Same basic syntax as HTML, with some important distinctions • All XML elements must have a closing tag • XML tags are case sensitive • XML elements must be properly nested • XML documents must contain a root element • Attribute values must be quoted

  4. XML Example 1 • <note date="10/01/2008">  <to>Tove</to>  <from>Jani</from>  <heading>Reminder</heading>  <body>Don't forget me this weekend!</body></note>

  5. XML Example 2 • <note>  <date>10/01/2008</date>  <to>Tove</to>  <from>Jani</from>  <heading>Reminder</heading>  <body>Don't forget me this weekend!</body></note>

  6. XML Example 3 • <note>  <date>    <day>10</day>    <month>01</month>    <year>2008</year>  </date>  <to>Tove</to>  <from>Jani</from>  <heading>Reminder</heading>  <body>Don't forget me this weekend!</body></note>

  7. What is AJAX? • AJAX stands for Asynchronous JavaScript And XML • Technique for developing dynamic web pages • Allows web pages to be updated asynchronously by exchanging data with the server • Possible to update parts of a web page without reloading entire page

  8. How does AJAX work?

  9. XMLHttpRequest Object • All modern browsers support XMLHttpRequest object (IE5 and 6 use ActiveXObject) • Syntax for creating XMLHttpRequest object: • Variable = new XMLHttpRequest(); • Sending a request to a Server • Variable.open(method, url, async); • Varialbe.send();

  10. Assignment • Create your own simple XML document • Display it dynamically on your own web page • You can look at http://dsalinasez.no-ip.biz/ for example source code • http://dsalinasez.no-ip.biz/cd_catalog.xml for example xml document. • Email me at dave_salinas@yahoo.com

More Related