Web Development Presidio Texas

jQuery Mobile & AJAX – Asynchronous JavaScript & XML

By Web Development Presidio Texas

jQuery Mobile and AJAX - Asynchronous JavaScript And XML

Web Development Presidio Texas on how jQuery uses AJAX (Asynchronous JavaScript and XML) and JSON (JavaScript Object Notation) data for asynchronous updates.

“To load an external file, we just link to it. If it’s on the same domain as the current document, it gets loaded using AJAX and a nice automatic transition… With this link, jQuery Mobile will suspend the default linking behavior and replace it with a “behind the scenes” AJAX call to retrieve external.html’s contents, inject it into the current document and transition to it, as with internal pages. In the meantime, the framework will show a nice loading animation over the page.”

Continue to… Getting Started With jQuery Mobile

“This is how you can generate data for use with AJAX using a POST method which contains JSON data and then pass it to a PHP script and then decode ready to use as variables (name value pairs). In this example, I’ve used form input values to generate the data passed as a JSON string, but you can create your own JSON data to pass doesn’t have to be from a form.”

Continue to… jQuery to PHP via AJAX using JSON

“Self-submitting Forms. You can submit forms to the same URL you’re currently viewing by setting the form’s action attribute to that URL, as demonstrated on this page. When a POST request is submitted to a page that’s already in the DOM (which would commonly happen when submitting a form to the same URL currently in view), the response URL will be identical to that existing page, as POST requests do not append query string parameters to the URL. In this situation, jQuery Mobile will replace the page that submitted the form with the page returned in the response body.”

Continue to… Ajax Form Submission

“Getting started with AJAX is super easy when you use the jQuery library. That works well for the client side, but how do you work with a server side language like PHP? It’s easier than you think… I’ll show you how to create a simple call to a PHP document that will process something you type into a form field and update an element without needing to refresh your browser. Once you learn how to get jQuery talking to PHP, your web applications will never be the same.”

Continue to… Learning how to use jQuery AJAX with PHP