First let's start off with the gist of what you can do with this script:
You can have an input field on a web page that will, as you type into it, take the content of the field, pass it to a server side script and be returned to be placed inside a div that you specify.
Using this you can create a live searching feature or, what I will be doing with it, an authentic Textile preview feature.
First things first. I can not give Bitflux's chregu enough credit for the inspiration for this. That code is the basis of liveRequest and as such falls under its license (which is basically do whatever, give credit, retain the same license.)
So, go to the link above, read about how this started, and then come back here.
Now, head off to Apple to skim their guide to XMLHttpRequest.
You may also want to read up on the JavaScript Textile Preview I helped improve.
Give me the actual examples now!
Now, the live search feature with that snazzy XMLHttpRequest got me thinking, "what else could i bring back from the server?"
How about actual parsed Textile code without a page reload ;-)
You can thus see a working proof: Live Textile Preview in action
To create this, I almost completely rewrote a large chunk of the liveSearch.js provided me. In addition to cutting it down to just the request and return portions, I modularized it so that I can take the code from textile previews to live search results with just 4 lines of code.
If this has piqued your interest, both live-search and real-live-textile are free to download.