Building an AJAX Application (1): It isn't called AJAX but Remote Scripting

(By Mark Qian on 7/14/2006)




 

PREFACE

It seems that the word "AJAX" has been flooded everywhere these days when people are talking about web development. People use "AJAX" to label a much bigger territory, Remote Scripting. AJAX is only formally supported by major browsers for a short period but Remote Scripting has been used for a long long time (See one concrete example). If you think AJAX is as "simple" as - create a XMLHttpRequest Object - make a call with callback handler - handle server response in the handler you are wrong. AJAX, no, Remote Scripting, means not only being able to make requests to server and update your pages partially without reloading the entire pages but also introduces a totally different manner/pattern of communication to the server. The intention is "minimizing loading entire page" to save communication bandwidth, reduce server load, and optimize visual effect. On the other hand, Remote Scripting breaks some traditional "rules" that browser originally introduced and people have got along with such as going Backward and Forward in web surfing history, client-state preservation. The goal of this paper is starting at what AJAX has and what are shorted in "AJAX" to bring up most major issues and their solutions/approaches on Remote Scripting. For each issue, illustrate them at two levels: 1). A variety of solutions (either by Mark Qian or others) on remote scripting will be listed. 2). For each solution, a variety of live implementation will be shown(either by Mark Qian or others).

A. What features does AJAX have?

AJAX, Asynchronous JavaScript and XML, is just a feature, relatively "newly" being available in browsers which implemented it differently. So let's see what this browser feature offers. a.Communicate with server Asynchronously
    • Forces
    • Show details:
    • Solutions
    • Show details:
b. More "AJAX has" features will be added here ...

B. What problems does AJAX have?

AJAX is actually a "subset" of "Remote scripting". Personally, I think it is not the best approach (Why? See my explanation in "What is wrong with those most popular web application frameworks?") amoung most of approches in "Remote scripting" territory. So it is why I use it as the starting point to illustrate a variety of issues we need to face when remote scripting. Let's take a look at the issues. a. AJAX can't be used crossing domain
    • The Problem
    • Show details:
    • Solutions
    • Show details:
b. AJAX has problems with the "back" buttons and bookmark of browsers
    • The Problem
    • Show details:
    • Solutions
    • Show details:
c. AJAX does not preserve client-side page states
    • The Problem
    • Show details:
    • Solutions
    • Show details:
d. AJAX may be over chating with server
    • The Problem
    • Show details:
    • Solutions
    • Show details:
e. AJAX is bypassing the core of browsers, the renderers
    • The Problem
    • Show details:
    • Solutions
    • Show details:
f. AJAX is bypassing the browser's form submission functionality
    • The Problem
    • Show details:
    • Solutions
    • Show details:
g. AJAX could be turn off in some major browser like IE (6.x)
    • The Problem
    • Show details:
    • Solutions
    • Show details:
h. More "AJAX doesn't have" features to be added...