open ways. free horizons. mind at ease.
Главная
portfolio designers contact

Client-Server Interaction Via JavaScript

February 22nd, 2010

The idea is to display a server response without reloading the page. Say, the user opens a catalog page and adds N items to her/his shopping cart. Without requesting a new page, the web site application sends the data (unit_id, amount) to the server, receives confirmation from the server, and updates the cart display on the same page.

The platform chosen for this functionality is AJAX – based on the following comprehensive introduction: Asynchronous JavaScript Technology and XML (Ajax) With the Java Platform.

  1. We will need some PHP-generated XML, so let’s start with a simple script: <?php header("Content-type: text/xml"); echo "<message>hello</message>"; ?>

to be continued…