1 Overview

ScriptServer provides tools to "hook up" PHP and Javascript, for the purpose of fetching data from PHP into a web page which has already loaded, without reloading the entire page.

The objective is to make connecting a Javascript client with a PHP server as painless and error-free as possible. To this end ScriptServer allows you to define a class in PHP and call it’s methods directly (and remotely) from Javascript. That means if you have a PHP class like;

<?php

//...

class Math {

    function add($x, $y) {

        return $x + $y;

    }

}

//...

?>

You can use this class ”natively” from JavaScript on the client-side, calling it like;

var m = new math();

alert( m.add(2,2) );

The intent is to make building ”sticky” DHTML or web-based XUL http://www.mozilla.org/projects/xul/ applications, where the user interface remains static (not reloaded) in the users web browser, while data can be fetched dynamically from a remote web server, in response to user events.

Note: this is not an XML-RPC implementation. In fact it’s completely XML-free. See 2.2.3 and Keith on ScriptServer http://keithdevens.com/weblog/archive/2004/Oct/06/ScriptServer for details.

1.1 This Document

Head to the Introduction (2) if you want the theory. Head to Developing with ScriptServer (3) for the hands on stuff.