With ajax agent, transfer data between the browser and the web server (HTTP request) occurs asynchronously. This is what allows a web page to request a small amount of data from the server without reloading the entire Web page.
Ajax usability in a web, is an important thing. Why so, because in ajax there are many advantages, for example, you may often see a website which if clicked on a particular button or link, the web page is not switched to the new page, but rather only partial pages are changed, it was called ajax, ajax function which is called partial page of a website so that the website can be accessed quickly.
With ajax agent techniques we can develop web applications fast and responsive as well as desktop applications. The web applications have characteristics such as desktop applications are often referred to as Rich Internet Application (RIA).
Ajax Agent Class is a very easy to use, yet very powerful open source framework for rapidly building AJAX or Rich Internet Applications (RIA). It is based on JSON & hence supports complex data types like associated arrays & objects.Aims to make Ajax work as simple as possible. Based on KISS (keep it simple stupid)
There are three steps to get started with the ajax agent :
include_once('agent.php'); /*reload ajax agent class*/
$agent->init(); /* initialize the agent framework & instantiate the server side */
Example use ajax agent in case :
1. Create php file as index.php and copy code below to your file :
agent.call('functions.php','myname_function', 'client_callback', name);
<label>Text your name here : </label><input type="text" id="name" />
<button onclick="myname();">Click Me</button>
2. Copy Agent.php on the same folder with index.php, you can download ajax agent < a href=”https://seegatesite.com/wp-content/uploads/2014/10/ajaxagent-0.4.tar.gz” title=”ajax agent download” alt=”ajax agent download”> here
3. Create functions.php file on the same folder with index.php and copy this script below
$retval= 'Hello, my name is '.$name;
I hope it can help you to create web application as desktop flavor with ajax agent. I implement ajax agent on my tools to amazon asin grabber, amazon scraper product,etc.. please visit https://seegatesite.com/tools/ to demo site
Latest posts by Sigit Prasetya Nugroho (see all)
- Let’s Get Acquainted And Learn About VUE JS 2 Tutorial For Beginners - August 6, 2018