JSCP introduction
Feb 2007, Ting Xu xuting@263.net.cn

Initially in middle of 2006 an idea appeared in my mind, and i didn't find any open-source javascipt library to do this work, so at Oct 2006 i wrote this library myself (based on Prototype library), i call it Javascript Client Page - JSCP.

The key idea in Jscp is rendering page template with data on browser-side (in web browser program). The UI of web applications are deployed on server-side, but are rendered on browser-side. The compute resource of server are always not enough, why let it do the needless work? With this change, The interfaces between browser-side and server-side are communication of pure data (in JSON format from server to browser)

The traditional service model is:

1 browser --- [send request] --> webapp server
2 browser
(waiting...)
webapp server (working for the request, get result data)
3 browser
(waiting...)
webapp server (rendering page template with result data)
4 browser <-- [recv result page] -- webapp server

With Jscp library, the model becomes:

1 browser --- [send request] --> web server
2 browser <-- [recv page templage] -- web serve (page templage can be preloaded/cached for many times use)
3 browser --- [send request] --> webapp server
4 browser
(waiting...)
webapp server (working for the request, get result data)
5 browser <-- [recv result data] -- webapp server
6 browser
(rendering ...)
webapp server

Though the idea and the implemention technology of JSCP is simple, it gives us web programmers more power and more flexibility. With Jscp, some browser-side effects are easy to implement, like local pagination, local table ordering, etc (see samples). I think the important meaning of JSCP is that it change the web application model, the interfaces between browser and server exchange only data, they could be defined strictly, and server-side developping is concentrated on business/data logic.

Jscp doesn't care your server-side platform, all work ok (Ruby on Rails, PHP, JSP, ASP/ASP.net, etc), maybe from now you could stop using view models they provide.

Jscp is not in conflict with other Ajax technologies, it is on the bottom layer of them. Jscp use two features of Prototype library: Asynchronous HTTP communiation and Class/Object framework.