version française

By Julien Lamarre, 2005/09/20


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 a stylesheet

  • This technique will only work if your browser supports [an element].currentStyle() or window.getComputedStyle(). This means it won't work with old browsers.

  • The client to server connection works by making a stylesheet's ".href" property point to the PHP file, followed by the request's parameters.

    The server's response is done by generating a stylesheet that includes the response inside the "background-image" property of an hidden div.

  • This technique's main limitation is the number of characters that can be used for a "background-image" property's value. An iteration method that would split the server's response and send it chunk by chunk would be a good idea to deal with this.

    There is also the fact that only recent browsers can be targeted.

  • The associated PHP file: stylesheet.php

Your browser does not meet all the requirements for this script to work properly!
  • javascript support
  • document.getElementById() support
  • [an element].currentStyle() or window.getComputedStyle() support

1. Hello World!






2. Addition

+ =




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

- Data taken from http://www.stetson.edu/~efriedma/numbers.html