1 / 13

AJAX

AJAX. Asynchronous JavaScript and XML. AJAX = Asynchronous JavaScript and XML. AJAX is not a new programming language, but a new way to use existing standards. AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page. What is AJAX?.

strongr
Download Presentation

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. AJAX Asynchronous JavaScript and XML

  2. AJAX = Asynchronous JavaScript and XML. • AJAX is not a new programming language, but a new way to use existing standards. • AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page. What is AJAX?

  3. In brief, it’s a solution to one of the big annoyances of web interfaces. Generally, the user inputs some data or makes a choice, and clicks a button that sends the data to the server. The server takes a look at the data and sends back a whole new web page, which is loaded into the browser. Reloading a page every time you want to do something is annoying, disjunctive and time-consuming for the user.  What is AJAX?

  4. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page. • Classic web pages, (which do not use AJAX) must reload the entire page if the content should change. • Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs. What is AJAX?

  5. When javascript was released, people loved all the cool things you could do with the web browser to make a more user-friendly experience. You could do form validation, quirky popup messages, make cool web tools and more. However, Javascript had no way of sending information between the web browser and the web server. • If you wanted to get any information from a database on the server, or send user information to a server-side script like PHP, you had to make an HTML form to GET or POST data to the server. The user would then have to click "Submit", wait for the server to respond, then a new page would load with the results. I'm sure we have all gotten slightly annoyed when having to wait for especially slow websites! • Ajax attempts to remedy this problem by letting your Javascript communicate directly with the server, using a special Javascript object XMLHttpRequest. With this object, your Javascript can get information from the server without having to load a new page! AJAX = Js on Steroids

  6. It is used to send HTTP or HTTPS requests directly to a web server and load the server response data directly back into the script. • XMLHttpRequest moves that browser-server interaction to behind the scenes, so the user can just keep on playing with the same page, even while elements on the page are talking to the server!  XMLHttpRequest

  7. How AJAX Works?

  8. Despite the name, the use of XML is not needed (JSON is often used instead). • AJAX can get a full parcel of data back from the script it calls. Hence the “XML” part of the name – which really is just there for looks, kind of like the “Java” part of JavaScript, because the returned data can be plain text or whatever you like, if XML is overkill or just not your cup of tea. The X in AJAX

  9. Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. What is an XML file?

  10. <CATALOG> • <CD> • <TITLE>Empire Burlesque</TITLE> • <ARTIST>Bob Dylan</ARTIST> • <COUNTRY>USA</COUNTRY> • <COMPANY>Columbia</COMPANY> • <PRICE>10.90</PRICE> • <YEAR>1985</YEAR> • </CD> • <CD> • <TITLE>Hide your heart</TITLE> • <ARTIST>Bonnie Tyler</ARTIST> • <COUNTRY>UK</COUNTRY> • <COMPANY>CBS Records</COMPANY> • <PRICE>9.90</PRICE> • <YEAR>1988</YEAR> • </CD> • <CATALOG> Sample XML file

  11. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. • It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. • JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language. JSON

  12. { • "glossary": { • "title": "example glossary", • "GlossDiv": { • "title": "S", • "GlossList": { • "GlossEntry": { • "ID": "SGML", • "SortAs": "SGML", • "GlossTerm": "Standard Generalized Markup Language", • "Acronym": "SGML", • "Abbrev": "ISO 8879:1986", • "GlossDef": { • "para": "A meta-markup language, used to create markup languages such as DocBook.", • "GlossSeeAlso": ["GML", "XML"] • }, • "GlossSee": "markup" • } • } • } • } • }

  13. “The potential of Ajax-enhanced web apps is limited only by your imagination.” Making Your Own

More Related