Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts

Monday, September 29, 2008

Ajax Layer Ajax Library Examples

Large examples collection of Ajax Library : Ajax Layer JAVASCRIPT DHTML TUTORIALS

See at work :demo online Ajax Library : Ajax Layer

Wednesday, September 24, 2008

Is JSON Fast and Reliable?

JSON produces smaller documents, and JSON is certainly easier to use in JavaScript. XMLHttpRequest parses XML documents for you whereas you have to manually parse JSON, but is parsing JSON slower than parsing XML?


When it comes to making AJAX behave like a desktop application, speed is everything, and clearly, , JSON is a winner..


Test in your browser -Benchmarking AJAX - JSON vs XML.

Tuesday, September 2, 2008

Alternate Ajax Techniques Part 1 - Using iframe

1.Dynamic content loading in iFrame

HTML: iframe




The concept is simple: create a new iframe element and assign a valid url to its src attribute to load html content that isn't initially written into the page.


All you need to do is create a iframe element using the DOM createElement() method and add it to the page.

Read more..

DEMO of Example 1

AJAX PHR RSS Reader Step by Step Tutorial

Tutorial whith Demo about writing an AJAX RSS Reader. This AJAX reader is written in Javascript only, it just request a backend url on the same server then display the feed resulted as you can see in the screenshots below :

Preparing the XMLHttpRequest Object
In the first step the application prepared an XMLHttpRequest object to use it for loading remote RSS data. I tested the code with firefox only, but I added ActiveXObject in case IE was used.

   var RSSRequestObject = false; // XMLHttpRequest Object

if (window.XMLHttpRequest) // try to create XMLHttpRequest
RSSRequestObject = new XMLHttpRequest();

if (window.ActiveXObject) // if ActiveXObject use the Microsoft.XMLHTTP
RSSRequestObject = new ActiveXObject("Microsoft.XMLHTTP");

Writing the HTML code
Just few lines are enough, two divs are used by the application the status will inform about the progress of requesting data, and the ajaxreader will be the container in which the result will be displayed. The first thing then to do onload page is to run the AJAX Reader.

  

AJAX RSS Reader





The AJAX RSS Reader

The AJAX Reader will request the backend URL and run a function ReqChange() when the data will be loaded. I have just added few additional function for usability purpose to display the status and hide it ...

 var
Backend = 'rss.php'; // Backend url .....
Read complete article
You can find the AJAX RSS Reader
script running online

Open Source Scripts and Programs Ajax Javascript

Thousands of open source Javascript /Ajax projects
XML parsers
Content Editors
Image processing

MySQL to JSON

Add to simplicity and might even save some valuable server time. If you're running MySQL 4.1 or later you can use the nifty function GROUP_CONCAT() together with the normal CONCAT() function to build all your JSON straight from your SQL query.
username email
tommy tommy@tommysplace.com
jane jane@examples.com
jack jack@iford.com
Our SQL table.
SELECT
CONCAT("[",
GROUP_CONCAT(
CONCAT("{username:'",username,"'"),
CONCAT(",email:'",email),"'}")
)
,"]")
AS json FROM users;
A MySQL-query that returns JSON.
[
{username:'tommy',email:'tommy@tommysplace.com'},
{username:'jane',email:'jane@examples.com'},
{username:'jack',email:'jack@jiford.com'}
]
The returned JSON structure.

AJAX Speed Up the Web

In the AJAX tutorial below we will demonstrate how a web page can be loaded 10 time faster using ajax.

This is the HTML page . It contains a simple HTML table,couple css rules and a link to a JavaScript