AjaxLike


Quick start:

Here you will find interesting experiments about ajax like technology without the XmlHttpRequest object. How to get the plus without the annoyances.

Ajax technology is in short a way to fill an area of a page with a server side script without reloading the page and disrupting the user experience. While the server side script can act regarding some parameter passed.

Start wondering, is there any javascript element that relate to external file content. The Script element seems to be the candidate as it own a SRC property, let's create it dynamically and experiment.

Example: al1.html with a DIV called scriptelement, on the press of a button execute ajaxlike function to create a scriptelement src is al1.js, this javascript replace itself by string value Hello, show me.

Promise done, we can replace a selected page content without reloading the Page.

Now try it with different browsers, FireFox, Opera and Explorer, it works.

Global variables:

What's about trigerring same process but result depending of global variable content.

Example: al2.html contain two global variables declared outside functions, named request and response, al2.js external javascript can read request and set response to be displayed, show me.

Scripts updating same area:

What's about trigerring different scripts but result updating same DIV.

Example: al3.html contain two buttons each pass a different ScriptURL, al31.js or al32.js return different color response, show me.

Conclusion:

You can create and load any javascript that update only a DIV content of a page without reloading the page, even passing and returning variables.

Calling PHP Scripts:

What's about trigerring different language scripts residing on servers.

Example: al4.html contain a button to call a al4.php residing on a server, show me.

Discussion: