Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A
What is AJAX? Asynchronous JavaScript And XML A bundle of technologies used together to enhance user experience by altering displayed information on a web page without a page refresh. Employs HTML, CSS and JavaScript on client (browser) side, plus any one of a number of server-side technologies. PHP is the most popular server-side technology in AJAX implementations.
AJAX visual model Web Page Request made to JS function JS function makes XMLHTTP request to PHP script PHP script returns output to the JS function JS function updates Web Page
What is jQuery? A “JavaScript Library” that simplifies HTML and document traversing, event handling, animating, and AJAX interactions. A short hand for writing JavaScript with fewer lines of code do to the same things. “Write less, do more”
jQuery Syntax Examples Standard js: var foo = document.getElementById(‘bar’).value; jQuery: var foo = $(‘#bar’).val();
XMLHTTP Request with jQuery $.ajax({ type: "POST", url: "some.php", data: "name=John&location=Nashville", success: function(msg){ alert( "Data Saved: " + msg ); } });
Tutorial/Demo Simple “tweeting” app
Demo Q&A Any questions?
Resources Beginning Ajax with PHP, Lee Babin, Apress, Amazon id: W3chools AJAX tutorial:
Find Me Phone: Dept Website: Web Development Blog: