This is a demonstration of a very fast and easy way to build AJAX-type applications where communications between JavaScript on the client side and PHP5 on the server side is ideal. This library makes development of such systems fast and very simple.
Updating the user list should occur whenever the user adds a new chat message or refreshes the chat window. Since we already use the MessageAction() method on our PHP IndexController class to forward such responses to the browser, we'll simply amend it to also return a list of currently online users. To assess which users are online we may assume each screen name is a separate user. This isn't accurate since a user may change screen names as many times as they wish but will suffice for now. If we maintain the current application design we could improve this by using the PHP Session id as the basis to narrow screen names down to unique users. If we used a database and enforced user accounts, this would not be an issue.
We'll also assume an online user is one who has submitted a message in the previous five minutes. Since both screen names and message timestamps are stored in our XML file, we can use XPATH to capture the necessary data.
This is a two-part article. In these two parts I'll try to describe what AJAX is, and how to use AJAX in PHP and JSP. Later we will use some advanced JSP tag libraries to make cool AJAX-based web applications.
Please remember, AJAX is not a new programming language, so you don't have to learn anything new. AJAX involves just using the existing standards (JavaScript and XML) in a different way. AJAX became popular because of Google in 2005. AJAX becomes a common ingredient in web 2.0-based web applications.
Why do we need AJAX? Often web-based applications are not as user-friendly as desktop applications. Using AJAX, we can create a feature-rich and easy-to-use graphical user interface for web applications. AJAX is supported by most of the web browsers available today.
Have you guys ever seen the edit button on vbulleten boards or the edit comments button on digg, which allows the user to seamlessly edit their content without reloading the page. Well, we are going to implement the same AJAX edit-in-place functionality in this tutorial.
Suppose we have an article page on our site where people can edit articles. The article has an edit and save button which allows the user to edit the article and save the changes as necessary. View the ajax_edit_in_place demo to see what I'm talking about.
To accomplish the editing and saving feature in AJAX, we're going to make use of Prototype AJAX library. It's a single javascript file called prototype.js.
Prototype is a powerful library with all the necessary functions we need to build an AJAX driven applications. If you're looking to get started with AJAX, i recommend you look into using Prototype API. I've written this tutorial which will help you get started with PHP and AJAX using Protoype lib..
AJAX is a very powerful system which enables dynamic, constantly changing content on a page--without refreshing the page. This useful system does, however, have some limitations with current browsers. We will cover these limitations in this article, specifically those pertaining to how HTML Forms operate within AJAX dynamic content and what type of JavaScript can be used in AJAX-generated content.
In Part 1 and 2 of this series on AJAX, we gave you a good understanding of how AJAX works. Now we will use a slightly different approach to doing the Asynchronous data send/receive with AJAX--we will use the POST method instead of the GET method!
AJAX and PHP 5 both have powerful features for processing and using an XML document. XML is a method of formatting data, often for communication purposes, between different computer systems. In this article, we will show you how to access an XML document with AJAX!
So you're interested in AJAX? AJAX is a powerful addition to JavaScript for browser-to-server intercommunication. We will demonstrate a simple script that sends a GET or POST request to a form handling script on a server, then the server script will return a response to the browser XMLHttpRequest JavaScript object.
Dieses Tutorial stellt die Grundlagen von Ajax vor. Dabei wird PHP als serverseitige Grundlage genutzt.
Ein allgemeiner Abschnitt erklärt das Funktionsprinzip von Ajax. Der auf der Seite des Servers werden XML Dateien und Json Rückgaben erzeugt. Dabei werden verschiedenste Pear Klassen verwendet.
Ein Blick in dieses Ajax Tutorial lohnt sich.
Web development is messy. Over the years, our toolbox has filled up with odd implements that are hard to use and don't fit well together. Web code has become a legacy problem. A typical web page is a tangle of HTML, JavaScript, and server-side scripts. User interface logic is interwoven with business rules and client-server communications. In most programming environments, we use documented APIs, so you just pass arguments to a function and get back the results. In the web environment, we've typically needed hacks like populating hidden fields in a form, and regenerating the whole page, even for a tiny change. Can we make the process more rational?
Click here to find out more!
This article describes a makeover of a typical database-backed web form. We'll show some old code – a mixture of HTML, JavaScript, and PHP – and rebuild it with modern web techniques like Ajax, and modern tools like jQuery. The benefits will include:
* Separating dynamic content from static content.
* Separating content, style, and processing.
* Web client-server communication via function calls.
* Partial page updates instead of flash-bang page reloads.
* Faster development and more maintainable code.
* Faster load times and improved caching.








News von