Archive | Ajax RSS feed for this section

28 May 2008 View Comments

Google: Ajax Libraries API

Google: Ajax Libraries API

Here’s some cool stuff – Google’s Hosting some popular Javascript Ajax libraries like jQuery, prototype and the likes on their servers. You use this service to serve the supported libraries straight off Google. They also provide you with the option to load a particular version of the library so you won’t have to keep checking your code everytime a latest release is made.

Here’s how you would load jQuery version 1.2.3 using this API:

<script src="http://www.google.com/jsapi"></script>
<script>
  // Load jQuery 
  google.load("jquery", "1.2.3");
 //Continue using jQuery
</script>

The AJAX Libraries API is a content distribution network and loading architecture for the most popular open source JavaScript libraries. By using the Google AJAX API Loader’s google.load() method, your application has high speed, globaly available access to a growing list of the most popular JavaScript open source libraries including:

Google works directly with the key stake holders for each library effort and accept the latest stable versions as they are released. Once we host a release of a given library, we are committed to hosting that release indefinitely.

Links:

Google Ajax Libraries

Documentation

Zemanta Pixie

27 May 2008 View Comments

PersistJS: Cross Browser Client-Side Persistent Storage

PersistJS: Cross Browser Client-Side Persistent Storage
The Firefox Cookie Manager, showing the details of various cookies by domain

PersistJS is a simple to use Javascript to store persistent data on the client Browser. This library supports multiple back-ends which are listed later. The following example will show you how easy it is to store and retrieve data using PersistJS.

To Store Data:

// create a new client-side persistent data store
var store = new Persist.Store('My Data Store');

// pretend data
var data = "pretend this is really long data that won't fit in a cookie";

// save data in store
store.set('saved_data', data);

To Retreive Data:

// get data back from store, and prompt user with it
store.get('saved_data', function(ok, val) {
  if (ok)
    alert('saved data = ' + val);
});

PersistJS addresses all of the issues above. It currently supports persistent client-side storage through the following backends:

* flash: Flash 8 persistent storage.
* gears: Google Gears-based persistent storage.
* localstorage: HTML5 draft storage.
* whatwg_db: HTML5 draft database storage.
* globalstorage: HTML5 draft storage (old spec).
* ie: Internet Explorer userdata behaviors.
* cookie: Cookie-based persistent storage.

You can also remove storage engines you don’t want to use in PersistJS by removing that storage engine by code:

// never use cookies for persistent storage
Persist.remove('cookie');

Links:
PersistJS Project Home Page
Download PersistJS

6 January 2008 View Comments

ImageFlow – Javascript Image Gallery

ImageFlow

Here’s a cool image gallery script written in Javascript. It’s quite easy to integrate into your site. This is how the author describes ImageFlow:

ImageFlow is a picture gallery, which allows an intuitive image handling. The basic idea is to digitally animate the thumbing through a physical image stack. That intuitive handling is automatically caused by the metaphorical use of the well known process of thumbing through.

The script is compatible with the browsers on Windows, OSX and Linux:

  • IE 6.0+
  • Firefox 2.0.0.9+
  • Opera 6.0+
  • Safari 1.3.2+
  • Konqueror  3.5.7

ImageFlow

The current version of ImageFlow’s features are listed below :

  • Supports most image formats
  • Supports large amounts of images (>100)
  • 100% JavaScript
  • Scroll bar
  • Mouse wheel support
  • Arrow-key support
  • Loading bar
  • Captions
  • Supports image links
  • Scales 100% dynamically
  • Implemented using div Tags

Links:
Download ImageFlow 0.8
ImageFlow Site
ImageFlow Documentation

Tags:
22 October 2007 View Comments

Record mouse movement using AJAX

Instead of eyeball tracking for usability professionals, here’s a way to track the mouse movements and click events of a user on a page.

The “movelogger� records the mouse movement a users does on a web site. Just before the user leaves the current page, the recorded data get posted back to the server using AJAX.
The cool thing is that you can “replay� these movements afterwards.

Want to try out a demo ? Check this link: http://pure.rednoize.com/movelogger/
Link: puRe aka Marcel Oelke » Record mouse movement using Javascript and AJAX

18 September 2007 View Comments

Really Simple History – History for Ajax

If you’re working on Ajax based websites, you’ll always face usability problems when users click on the Back or Forward buttons on the broswer. Using Really Simple History (RSH) allows you over come this issue.

The Really Simple History (RSH) framework makes it easy for AJAX applications to incorporate bookmarking and back and button support. By default, AJAX systems are not bookmarkable, nor can they recover from the user pressing the browser’s back and forward buttons. The RSH library makes it possible to handle both cases.

In addition, RSH provides a framework to cache transient session information that persists after a user leaves the web page. This cache is used by the RSH framework to help with history issues, but can also be used by your own applications to improve application performance. The cache is linked to a single instance of the web page, and will disappear when the user closes their browser or clear their browser’s cache.

RSH works on Internet Explorer 6+ and Gecko-based browsers, like Firefox. Safari is not supported.

Link: Really Simple History
Demo Link: testDhtmlHistory.html (try using the browser back button after you get to this demo)

Tags:
5 June 2007 View Comments

Caching WordPress offline using Google Gears

Google Gears

Google Gears

If you’re still wondering what you can do with Google gears, here are a tutorials to get you started on the right track. Nick Halstead takes you though how to cache WordPress pages using Google Gears:

I was instantly fascinated by Google Gears so I had to immediately try out the sample code that you can download. The tutorial on the website gives a simple example of how to cache a few files using the Resource Store. It makes it very easy to setup a JSON manifest file that contains which pages you want to have cached.

Link: Google Gears Caching of WordPress in PHP

31 May 2007 View Comments

Google Gears for offline apps

Google has released a beta version of Google Gears which is an open source browser extension which  enables web applications to provide offline functionality using following JavaScript APIs.

Here’s what you can do with the API’s:

  • Store and serve application resources locally
  • Store data locally in a fully-searchable relational database
  • Run asynchronous Javascript to improve application responsiveness

You can take a look at the sample applications at http://code.google.com/apis/gears/sample.html once you install the browser plugin.

The news out there is that Google’s planning to offer offline support for their current applications like Google Reader, Docs & Spreadsheets.

Tags:
18 May 2007 View Comments

PHPLiveX – Tutorial

If you’re looking for the quickest way to get your PHP functionality Ajax enabled, you’ve got to take a look at PHPLiveX. It greatly simplifies the process of Ajaxifying your PHP code without knowing Javascript code.

Let’s see how to Ajaxify a simple PHP function. Let’s create a simple function to output the server time:

function myServerTime(){
	return date("D M j G:i:s T Y");
}

First you have to include the PHPLiveX library and register your function. Here’s how to to it:

<? php
  include 'PHPLiveX.php';
 
	function myServerTime(){
		return date("D M j G:i:s T Y");
	}
 
  $phplive = new PHPLiveX("myServerTime"); //Register the function with PHPLiveX
?>

$phplive = new PHPLiveX(“myServerTime”); is used to register our function myServerTime with PHPLiveX

Next let’s build our HTML Display. Let’s keep it simple, but allowing the user to click a link to get the updated server time:

 <a href="">Get Server Time </a>

Now we’ll have to create areas to display our Loading Status and the results back from the server. Let’s create two divs for this.

<span id="loading" style="visibility:hidden">Loading...</span>
<span id="serverResult" style='clear:both;'></span>

You’ll notice that the loading span’s visibility has been set to hidden by default. PHPLiveX will use this to show the loading indicator when an action is being performed.

Now let’s get the entire HTML created. PHPLiveX autogenerates the Javascript required to create the AJAX calls, this has to take place in the html head section. To generate the Javascript all you need to call is $phplive->Run(). So let’s get to the entire script with the HTML:

<? php
  include 'PHPLiveX.php';
 
	function myServerTime(){
		return date("D M j G:i:s T Y");
	}
 
  $phplive = new PHPLiveX("myServerTime"); //Register the function with PHPLiveX
?>
<html>
	<head>
		<title>My Ajax Server Time</title>
		<script>
			<?php
				$phplive->Run();
			?>
		</script>
</head>
<body>
 
<a href="javascript:myServerTime('', 'target=serverResult,preload=loading');">Get Server Time</a>
 
<span id="loading" style="visibility:hidden">Loading...</span>
<span id="serverResult"></span>
</body>
</html>

You’ll notice that in the Get Server Time link there’s a little bit of Javascript – javascript:myServerTime(”, ‘target=serverResult,preload=loading’);. That’s used to call the myServerTime function from Javascript. The first parameter is null since our function myServerTime doesn’t accept any parameters. The second parameter tells PHPLiveX to send the output to the “serverResult” div and use the “loading” div as the preloader.

That’s it ! You can see a demo of this here.
Get the source code for this tutorial here. This includes version 2.2 of the PHPLiveX library.

I’ll put up a tutorial on how to use PHPLiveX for a whois lookup next week.

Link to PHPLiveX: PHPLiveX -> An Open Source PHP/Ajax Library

5 March 2007 View Comments

miniajax.com

miniajax.com

miniajax.com

Miniajax.com is a showcase ofwhat’s hot in Ajax, with link to demos and tutorials showing how they’re done. Here are some of what you can see at miniajax.com

  • Ajax StarRating
  • Ajax Contact Form
  • In-place editing (like Flickr)
  • Bubble Tool-tips
  • Heatmap for websites and much more…

Link: miniajax.com

28 August 2006 View Comments

SQL Designer

SQL Designer

Looking for a quick way to design Databases without having to download software? Here’s an Ajax application which allows you to design databases online without having anything other than a web browsers installed on your system :)

This application allows you to define your tables and rows through an easy to use web interface. You can also link tables together by dragging and dropping the primary keys into other tables. You can export the database tables as XML, MS SQL and SQL Server statements.

Link: SQL Designer