Most all sure people have ever applied gmail, yahoo mail, google sugest or Google maps, and sure of all people realizes that the application is application bases on web which is dynamic and applies new programming concept. If it is observed farther the application seen like the application of desktop without using any plug-in and also special facility from web browser.
What is it is returned that semua?konsep does about gerangan? Devils having devils simply concept used in the application of web is AJAX. Food is the AJAX? AJAX itself is elongation from Asynchronous Java and XML. Term AJAX applied at website having interaction with server through javascript in asinkron ( background), so that consumer is me-load not necessarily overall of contents of page. This thing causes time irritant and bandwidth, also yields website which more and more interaktif.
Usually at application bases on traditional web, to change content a page hence page di-load mustre-, however by using javascript or cascading style sheets ( CSS), programmer web can make an dynamic application without having to re- me-load keseluruhn contents of its(the page. In this article writer will try explains in detail how technics makes application to base on web using concept AJAX.
Definition AJAX
AJAX itself introduced by an expert of program maker especially programming bases on web. The a real meritorious man not other and not not be Rasmus Lerdorf, from this Rasmus Lerdorf green thumb also some times last borned PHP.
To the application of AJAX in website, what required is browser providing service Javascript, and component XMLHTTP for consumer Internet Explorer ( IE), and XMLHttpRequest for Firefox, Safary, other Opera and browser. The conditions is almost certain has fufilled, remembers internet consumer a lot to apply IE and Firefox.
Actually there is no new thing in AJAX, because applied is technology javascript, which notabene have been long enough been applied. Therefore, for which have been accustomed to javascript, would easily study AJAX. This solution doesn't emphasize at one of technology ( Javascript, AJAX, HTML, PHP), however entirety from the thing. This thing is because usage of AJAX is not only at side client ( browser), but also entangles response from server.
By using this concept, page HTML can make koneksi in asinkron to server by the way of taking XML or document text. Hereinafter XML or document of this text will be applied by javascript meng-update to or modifies Document Object Model ( DOM) at page HTML.
Henceforth this technology also is recognized web remoting or remote scripting. Developer Web can combine indium plug, java applets or hidden frame mengemulasikan interaction to between page HTML with document XML. In technology Javascript has been provided an object that is XMLHTTPRequest. This object have been many disupport by many browsers like Internet Explorer, Firefox, Opera, Netscape and others.
Following illustration depicting interaction AJAX with Server :
Concepted this AJAX idea initially told by Rasmus Lerdorf. Rasmus Lerdorft arises this AJAX concept in a miling list ( milist). Having beginning of from milist is concept AJAX then is recognized and developed by many people. Following contents of milist sent by Rasmus Lerdorf.
List: php-general
Subject: [ PHP] Rasmus's 30 second AJAX Tutorial - [ was Re: [ PHP] AJAX & PHP]
From: Rasmus Lerdorf < rasmus () lerdorf ! com>
Date: 2005-07-21 22:50:56
Message-id: 42E026D03090601 () lerdorf ! com
I find an lot of this AJAX stuff an beet of a hype. Lots of people has
been using similar things long before it became " AJAX". And it really
isn't ace complicated ace an lot of people make it out to is. Here is a
simple example from one of my apps. First the Javascript:
function createRequestObject() {
var ro;
browser var = navigatorappName;
if(browser == " Microsoft Internet Explorer"){
ro = new ActiveXObject("MicrosoftXMLHTTP");
} else{
ro = new XMLHttpRequest();
}
return ro;
}
var http = createRequestObject();
function sndReq(action) {
httpopen('get', ' rpc.php?action='+action
httponreadystatechange = handleResponse;
httpsend(null);
}
function handleResponse() {
if(httpreadyState == 4){
var response = httpresponseText;
update var = new Array();
if(responseindexOf('|' != - 1)) {
update = responsesplit('|');
document.getElementById(update[0]).innerHTML = update[1];
}
}
}
This creates a request object along with an as of neodymium request and handle
response function. So to actually use it, you could include this js indium
your page. Then to make one of these backend requests you would tie it
to something. Like an onclick event or a straight href like this:
< a href="javascript:sndReq('foo')">
That means that when someone clicks on that link what actually happens
is that a backend request to rpc.php?action=foo will is sent.
Indium rpcphp you might has something like this:
switch($_REQUEST['action']) {
case ' foo':
/ does something /
echo " foo|foo done";
break;
...
}
Now, look at handleResponse. It parses the " foo|foo done" string and
splits it on the '|' and uses whatever is before the '|' ace the dom
element indium id your page and the part after ace the new innerHTML of that
element. That means if you has a div tag like this indium your page:
< div id="foo">
< /div>
Once you click on that link, that will dynamically is changed to:
< div id="foo">

