SAJAX – Simple Ajax Toolkit by ModernMethod – XMLHTTPRequest Toolkit for PHP

Now that XMLHTTPRequest has been renamed Ajax by Joe Public, it’s gaining more and more attention.
SAJAX is another toolkit, along the same lines as JPSpan in that you can call PHP functions directly from your web browser. The latest release also has backends for Perl and Python. Other language backends are a possibility if they’re contributed.
One major drawback of this project in it’s current state is, “Lack of type checking and support for rich return types”. JPSpan allows complex data types such as arrays to be passed back and forth between Javascript and PHP and from what I can see of the examples, SAJAX doesn’t support asynchronous calls either, yet.

multiplication example

/* PHP */
function multiply($x, $y) {
  return $x * $y;
}

/* JAVASCRIPT */
function do_multiply() {
  // get the folder name
  var x, y;

  x = document.getElementById("x").value;
  y = document.getElementById("y").value;
  x_multiply(x, y, do_multiply_cb);
}

What Iraq's checkpoints are like

What Iraq’s checkpoints are like

You’re driving along and you see a couple of soldiers standing by the side of the road – but that’s a pretty ubiquitous sight in Baghdad, so you don’t think anything of it. Next thing you know, soldiers are screaming at you, pointing their rifles and swiveling tank guns in your direction, and you didn’t even know it was a checkpoint.

(via dangerousmeta)