Tag Archives: ajax

Range Requests with Ajax

I ran across something the other day that made wonder about doing range requests using ajax. For some reason it wasn't obvious at first if this would be easy but as it turns out it is.

If you aren't familiar with range requests head over to the HTTP RFC and check out the range header. Your web server needs to support range requests for this to be useful but most do so that shouldn't be a huge issue. As a bonus you will find that some CDNs support range request as well (Amazon S3 for example).

Continue reading

Upgrade to PHP 5.2 and Get JSON For Free

A few days ago when PHP 5.2 was released one of the things that caught my eye was that it now includes the JSON extension. For anyone doing AJAXy type stuff JSON is an easy way to martial your data between your server side language and javascript.

For the longest time I've been using the older PHP JSON library to do JSON with PHP but now that the extension is included in the core I decided it was time to test it out. I took a couple of minutes and converted my DNSBL checker as a test since it has a fairly large data-set that gets converted and sent back. The json functions provided by the extension are probably easier to use since the JSON library needed you to create an object first but that wasn't a real issue. After making the change I could tell JSON extension was faster than the library. After a little digging I found that someone has done a little extension vs library testing and claims the JSON extension is 153 times as fast as the library.

Tags: ,

Some interesting and useful AJAX/Javascript code

I like seeing more and more uses of prototype. I'm not sure if the big guys will win out with their UI toolkits (Yahoo UI/GWT) or if it will always feel better to put things together by hand. Either way it is good to understand how this stuff works. This is an edit in place example that is similar to what you see on flickr.

I've seen something like this a number of times when I've visited sites. They want your feedback on something or other while you are browsing. It is a little floating plus feedback sign that hangs out in the lower right hand corner. Check it out.

Browsing digg I noticed an article on "unobtrusive sidenotes" and found that the idea is pretty cool: The announcement and code. They are done with javascript so you can turn them on and off on the fly.

Tags: , , , ,

AJAX file upload progress for Java using commons fileupload and prototype

This has been done before with PHP (AJAX upload progress meter for PHP) etc but I needed something a little different because I wanted to upload a file and then have it loaded into a database. I looked around and found that someone had already made something that used the commons file upload package to do the upload part (AJAX Upload progress monitor for Commons-FileUpload Example). It wasn't exactly what I was looking for but it a good start.

Continue reading