version française

By Julien Lamarre, 2005/09/20
Please visit: The meaning of life!


AJAX without XMLHttpRequest, frame, iframe, Java or Flash

  • Only an image, a stylesheet or a .js is used for the communication between the client and the server. The communication occurs without the need for the page to reload.
  • Those techniques are not necessarily the most useful or efficient, they have been developed only for fun and to demonstrate their feasibility.
  • For the code, look at this page's source and at the associated PHP file (comments are in french though).
  • This code is free as in "credits are appreciated", so use it or modify it as you want.
  • For more informations, or to leave a comment: psssst! (in french).


with an image    with a stylesheet    with a .js
 


AJAX using an image

  • The client to server connection works by sending a request to the server using a dynamically created image with some parameters added to its ".src" property.

    The server's response is sent in a cookie at the same time the generated image is returned to the client. Or, when cookies are disabled, by using the image's width and height to send, two by two, the characters forming the response!

  • There are some limitations and performance issues related to this technique, especially when cookies are disabled on the client.

  • A lot of improvements could be done. In the cookie version for example, an iteration method that would split the server's response and send it chunk by chunk would be a good idea to deal with a cookie's size limit.

  • Some people suggested me articles that describe a similar technique: article 1  article 2

    Both articles describe a technique using an image and a cookie. But those do not work when cookies are disabled.

  • The associated PHP file: image.php

Your browser does not meet all the requirements for this script to work properly!
  • javascript support
  • document.getElementById() support

1. Hello World!






2. Addition

+ =




3. What's special about this number? (enter a number from 0 to 9999)

- Can take time if cookies are disabled!
- Data taken from http://www.stetson.edu/~efriedma/numbers.html