Open main menu

CDOT Wiki β

Changes

BTC640/ProcessingAjax

723 bytes added, 13:05, 29 March 2012
Lecture
= Lecture =
 
Despite the title of this page the stuff this week doesn't have anything to do with Processing. If you've done the lab for last week (where you used requestImage()) that was a very similar concept.
Ajax is simply a way to make asynchronous (non-blocking) requests over the internet. Normally to make a request to a server you need to "go" to a URL, perhaps with some parameters. This is the traditional flow:
Also back and forward buttons don't work with Ajax requests. Again this can confuse and annoy your users.
 
== Spy on User Example ==
 
Depending on how much time there is left in the lecture I may implement this from scratch or just show you what I've done already.
 
The example will listen for mouse moves, mouse clicks, and ctrl+c. That information will be sent via Ajax to a my server script (written in PHP). That will record the time, ip address, and action in a file on the server.
 
It's nasty stuff (don't do this for your clients) but shows you how much power Ajax gives you as the website owner.
 
= Lab =
 
still to come..