About Sitellite       Screenshots       Downloads       Forge      Documentation       Community       Support

You are here: Home / Documentation / Client-Side RPC in Sitellite

Client-Side RPC in Sitellite

Further Thoughts

Now that we've looked at the benefits of RPC, and how to implement RPC within Sitellite, I thought I should fill you in on some additional aspects of RPC to consider before you go much further.

Accessibility

There may be accessibility limitations to JavaScript-heavy web applications, which may not be suitable for your application, depending on your target audiences. If you need to support alternative user agents, such as screen readers or mobile browsers, you should test before committing your project to using RPC.

RPC Techniques

There are currently two different methods of performing RPC requests in JavaScript: Iframe and XMLHttpRequest.

The Iframe technique manipulates the src attribute of a hidden HTML iframe tag to trigger new requests to the server without the full web page reloading. This technique is limited to HTTP GET requests only, and doesn't provide some other features that the XMLHttpRequest object does, but for simple requests this technique is more than adequate.

The XMLHttpRequest technique uses the browser's XMLHttpRequest JavaScript object to perform requests to the server without reloading the page. This object is available in Internet Explorer 5 or later for Windows, Mozilla, Firefox, and Safari 1.2 or later for Mac OS X. This object supports a range of methods which allow both HTTP GET and POST requests, the ability to abort requests, as well as the manipulation of additional HTTP headers. For more information about the XMLHttpRequest object, a good reference document is the following article on Apple Computers' Developer Connection web site:

http://developer.apple.com/internet/webcontent/xmlhttpreq.html

Sitellite's built-in RPC package uses the Iframe technique. Another PHP package, JPSpan, provides even more powerful RPC capabilities using the latter technique.

JPSpan

JPSpan provides both a PHP library and a JavaScript library to connect ordinary objects written in PHP to JavaScript, so that they act just like ordinary JavaScript objects on the client-side. This makes RPC programming for more complex tasks a very intuitive process.

JPSpan can be hooked into Sitellite easily by downloading and installing the JPSpan libraries into your Sitellite app, then importing them using the include() or loader_import() functions.

JPSpan is currently still in early beta stage (0.4.1 as of this article), but it is coming along fast, and is shaping up to be a great new project that will be an invaluable asset to many PHP developers.

JPSpan can be found at the following web site address:

http://jpspan.sourceforge.net/

Hopefully this article has shown you how client-side RPC can be a helpful new tool in your web development arsenal, and how Sitellite makes RPC-based web applications a much simpler task for web developers.



Page 1: Since the launch of Google's Gma...
Page 2: The End User Interface
Page 3: The Server-Side Handler
Page 4: Further Thoughts

All Tutorials

Members

Note: You can use your SitelliteForge.com account here and vice versa.

Username

Password

Forgot your password?

Not a member? Click here to register

Sitellite 5 Beta


Copyright © 2008, SIMIAN systems Inc.
All rights reserved. Privacy policy
Some of the icons on this site were created by the Gnome Project.