Understanding AJAX has finally made its way through the supply chain and is shipping from online places. I’ve even heard its available at book stores but I haven’t had a chance to see it in one yet. I’ll be stopping by one after work to grab some pictures.
Archive for the 'Understanding AJAX' Category
The lead story at ComputerWorld.com is an excerpt from my book Understanding AJAX. If you are thinking about buying the book, but needed more information to make a decision nows your chance. Head over to ComputerWorld read the chapter, check out the table of contents, and then pick up the book at Amazon or your favorite book seller.
The computerworld excerpt has been dugg, add your diggs if your interested in helping it spread. You can also get the article in PDF format from the publishers website if you’d rather take a look at the chapter in a layout like the final product.
I’ve added the Table of Contents to this site, so if your wondering more about the topics covered in the book, thats a good place to start.
I’ve also added a reviews section that links to reviews of the book, the first one is already out from AP Lawrence who got a copy of the pre-release manuscript.
Let me know if you review Understanding AJAX so I can add it too my list.
The last couple days have been a lot of fun. I was at LinuxWorld and did a book signing yesterday, my publisher had the first copies of Understanding AJAX at their booth. They should be showing up at bookstores and Amazon in the next couple weeks.
Your AJAX answers from my AJAX questions post are below, I hope everyone finds them helpful.
Dealing with broken connections
How can I find out whether a connection is broken? Should I just set a unique timeout per request after which an error message can be displayed? The timeout would be deactivated if the AJAX call succeeds. Is this a smart idea and does it work?
Using a timeout per request does work though its not a perfect solution. HTML_AJAX uses this approach, and a default timeout of 20 seconds. The issue is that 20 seconds is a long time to wait to provide an error, but there are still cases that hit this value. Its also hard to know what to do if you’ve hit an error, is this a transient failure and you should resend your request, or can you know longer talk to the server and you’re app needs to provide and error.
HTML_AJAX vs Prototype
CSS-style selectors, like those you use with the Behavior library gives you a good tool to write a degradable AJAX site, but the actual implementation can be pretty hard.
In general it means fully implementing a site without AJAX, then picking forms, links, etc that you want to make AJAX and tieing the AJAX too them at runtime. This works really well if your just doing something like type-ahead search since your not changing work flows, but it doesn’t always work that great for form submissions, since they often update different parts of the page, and the code that processes them is generally designed to build the whole page.
If your using AJAX for enhancements that don’t change the actual work flow then making your site degrable is easy. If your site relies on AJAX for its basic workflow you’ll have a much harder time making a site degrade.
AJAX File Upload
how can i make a file upload via ajax?
If you think of AJAX as involving using XMLHttpRequest then you can’t (at least not without disabling the browsers security model, which i don’t even recommend for intranet apps). But you can still upload files asyncronously, its just a matter of targeting a form at a hidden iframe. You will also want to look at generating your IFrame in JS since i believe it gives you less problems with browser history.
AJAX Form Submission
I’ve been studying AJAX for a bout a month now but I have not yet grasped the tecnique to submit a form with POST method. I’ve been trying to find an article that covered that but all I could find was the ones that included somekind of already made framework.
I want to know how to submit data to server (like form or email sending) with POST method.
Submit a POST request using AJAX you first have to understand what a normal form POST is.
When you submit a form in your browser it makes a http request with the following options:
HTTP Verb: POST
And a body of something like:
So to replicate a form POST in AJAX you need to run xmlhttp.open with POST set a header, xmlhttp.setRequestHeader(‘Content-type’,'application/x-www-form-urlencoded’);
Then encode your content and send it.
If you use a library most have code for handling this for you, HTML_AJAX has HTML_AJAX.formSubmit for taking a form and submitting it using AJAX and HTML_AJAX.post for doing custom POSTs.
Well nows your chance.
Submit your questions general AJAX questions, questions about my soon to be released book Understanding AJAX, questions on HTML_AJAX, or anything else I might know the answer of, and I’ll answer them in another post a couple days from now.
A chapter from my book, Understanding AJAX has been made available as a digital shortcut. This chapter covers the different ways you can use the data you transfer using XMLHttpRequest.
Document centric approaches based on HTML and XML are described as well as various RPC approaches are shown.
I don’t do much work with AJAX and XML, but client side XSLT can be a good solution if you need to move lots of data since it tends to scale better to extremly large datasets (especially in IE).
If your interested in the details of these various approaches grab the digital shortcut or pickup Understanding AJAX.
The milestone i’ve been waiting for has finally happened.
My book went to the printer yesterday at 3:30 p.m
I just signed off on the finished Understanding AJAX cover.
Its exciting to be so close to having the finished book.
AzPHP has a meeting tonight, hope too see you there.
I’ll my copy editing reviewing is finally done. I’m in the process of reviewing layout right now and getting the last of the fixes sent in.
Understanding AJAX is really close to getting done. Also i should have a full table of contents to post in the next couple weeks.
As a birthday present to myself I finished my last writing task (an Appendix containing AJAX libraries) on my book, Understanding AJAX.
The only thing I have left now is too review copy editing on the preface and appendixes and the back cover of the book.
Oh and I have to promote the book, and get the examples in a ready to ship state.
Not paying enough attention to dates I left myself 8 chapters of copy editing review to do in one night. The good news is I got it all done, which means all the heavy lifting for the book is done.
The bad news is i’ve been editing for 7 or 8 hours straight. The fun never ends.
Well thats not true, soon my part of the book creation will be done.
And then i get to setup demo’s advertise it, hmm a books the gift that keeps on giving
As you may have noticed I haven’t been bloggiing much lately, but there are a couple good reasons why.
First I’m getting married, planning the wedding tends to take a bit of time.
Second i’ve been working really hard to get a book about AJAX done.
The book is finally into production and I’m just starting to get some chapters back from the copy editor.
I do have one thing to share with you today, the books cover.
The ISBN is 0132216353
Also im still finishing up the books appendices which list AJAX libraries, so if you know of AJAX libs for various languages please let me know, im especially interested in AJAX libs for C#, Java, Perl, and Python I already keep up pretty good with all the PHP ones, and most of the non backend language specific ones.