Ajax examples (XMLHttpRequest examples), code snippets and proof of concepts - the links below should help get you started on building your own functions with XMLHttpRequest and Ajax.
A cool little blog post and demo that
Retrieves an xml atom feed and xsl stylesheet with XMLHttpRequest().
An example of using XMLHTTP to perform real time data validation, in this example for validating data entered into a user registration form. The example focusses on Microsoft and ASP.
XMLHttpRequest is one of modern DHTML's best kept secrets. - Haha, not anymore! Simon Willison offers up a little code that takes an HTML fragment, fetched via
xmlhttp.open, and inserts it into an element with a specified id. Some good links and comments follow the article.
He builds an example where, upon entering a postal code and pushing a button, a form queries the server for the rest of the address information and fills in the appropriate fields when the data is returned.
Jim Ley provides his overview of the XML HTTP request object, getting into some browser details and detection before providing some examples and getting into using XMLHTTP with google's SOAP API.
Drew McLellan provides an excellent overview of the basics of using XMLHttpRequest offering up a simple, well documented example used for checking if a username is available (similar to g-mail).
Three examples of XMLHttpRequest in use: autocomplete, live search, and live action.
From the site:
This library is meant to simplify and unify the code necessary to successfully send and receive simple data via XMLHTTP.
Apples page on the the XMLHttpRequest object, covering object creation, methods and properties in addition to security issues. They build an example for reading XML data, by retrieving iTunes RSS feeds that you select from a dropdown menu.
The wiki page for the livesearch function. From the page:
On the client side, we use XMLHttpRequest for sending the request to the server. There we have a little PHP script, which returns a small HTML file (http://blog.bitflux.ch/livesearch.php?s=PHP ) . This is then inserted into the page with some DOM manipulation.
A nice overview of the history and a good breakdown how the Suggest feature works.
From the site:
From the site:
This is my take on Google Suggest only with Amazon so I've called it "Amazon Zuggest". Head on over and give this a try.
This is a cool little app. When you are done searching, have a hover over the "History" list in the left hand column... The site comes up a little messy in Firefox...
A neat little script to play with (not sure what it has to do with weblogs especially tho). From the site:
A proof of concept, Ajax based login script that, in this case, uses a php/mysql backend. The author provides all of the scripts involved and lists some advantages and dis-advantages of his method.
Thomas Baekdal gets back into accessibility and Ajax. From the site:
Let's look at what we can do to turn an otherwise user-hostile XMLHttpRequest application - into a usable one.... An excellent write-up.
An excellent proof of concept and something I was waiting for someone to code up ;-). This XHTML live Chat uses XMLHttpRequest to post chat messages and to periodically check the server for new messages and update your chat window.
This is simply a proof of concept, and would work really well in a blog commenting setting or for forums when those fast threads start happening.
Here's an excellent application of the livesearch idea that has been seen around the web. Type in your search (a band name) and the results show up in a nice table below the search box.
Similar to other livesearch functions out there, only this one plugs into Google's API and has a Java backend, returning a list of results and descriptions for your query.
From the site:
Sproutliner is a free web service that helps you manage your projects and ideas. This tool looks to be very promising, and to be honest you have to try it out to 'get it'. It is a sort of Ta-da list on steroids, so to speak, in that it is very simple yet a user can add to it and tailor it to their needs.
Whenever I came across forgetfoo I was always amazed at the scripting being done on that site. This blog post outlines some very cool tricks using xmlHttpRequest. Be sure also to click on the comments (bottom) and the calendar (top).
While makaing some excellent points in the article, the little adventure game "The Search For Fonzieâ€™s Treasure" built using Ajax technologies is pretty cool. The author discusses user profiling as an "evil use" of Ajax. I'm not so sure that I would say that it is evil...
I started freelancing by diving in head first and getting on with it. Many years and a lot of experience later I was still able to take away some gems from this book, and there are plenty I wish I had thought of beforehand. If you are new to freelancing and have a lot of questions (or maybe don't know what questions to ask!) do yourself a favor and at least check out the sample chapters.
Like the other books listed here, this provides a great reference for the PHP developer looking to have the right answers from the right people at their fingertips. I tend to pull this off the shelf when I need to delve into new territory and usually find a workable solution to keep development moving. This only needs to happen once and you recoup the price of the book in time saved from having to develop the solution or find the right pattern for getting the job done..