>All Tutorials 
Ajax and .NET Ajax and .NET RSS XML
Ajax and ColdFusion Ajax and ColdFusion RSS XML
Ajax and Java Ajax and Java RSS XML
Ajax and PHP Ajax and PHP RSS XML
Ajax and SOA Ajax and SOA RSS XML
Ajax Goodies Ajax Goodies RSS XML
Ajax Tool Ajax Tool RSS XML
Facebook MockAjax Facebook MockAjax RSS XML
Google Web Toolkit Google Web Toolkit RSS XML
JavaScript Framework JavaScript Framework RSS XML
Ruby on Rails Ruby on Rails RSS XML
Technique Introduction Technique Introduction RSS XML
Without XMLHttpRequest Without XMLHttpRequest RSS XML
Yahoo! UI Yahoo! UI RSS XML

Creating a Loading Message - xajax loading function message script div head page

 
Registered tutorials: 501
Registered Users: 24390



Rating: 4.05 out of 21 votes cast


  
Category: Ajax and PHP

Creating a Loading Message

Digg this   Post to del.icio.us

Abstract: This tutorial shows you how to create a loading message to 'wow' your friends and impress your enemies. Prepare for battle!

One of the most simple but important parts of xajax is providing a 'Loading...' message as visual feedback for when xajax is doing a server call. xajax provides two Javascript functions that you can override to do this: xajax.loadingFunction() and xajax.doneLoadingFunction()

In this tutorial, we'll show you how to create a loading message to 'wow' your friends and impress your enemies. Prepare for battle!

First we'll set up a simple xajax page that has a really slow function in it.

<?php
require("xajax.inc.php");

function slow_function()
{
    $objResponse = new xajaxResponse();
    sleep(2); //we'll do nothing for two seconds

    $objResponse->addAlert("All done");
    return $objResponse;
}

$xajax = new xajax();
$xajax->registerFunction('slow_function');

$xajax->processRequests();
?><html>
    <head>
        <title>Loading Bar Demo</title>
        <? $xajax->printJavascript(); ?>

    </head>
    <body>
        <input type="button" onclick="xajax_slow_function();" value="Slow Function" />
    </body>
</html>

So now we've got the slow function and corresponding button, try clicking the button and see how painful it is that there's no feedback. Sucks don't it?



Read Full Tutorial...



Reviews:

Rate and Review This Site

No reviews yet


Statistic Information About this Resource:


Total Hits: 6015
Unique Hits: 5058


  Daily Weekly Monthly
  Unique Total Unique Total Unique Total
Average 5.6 6.5 33.9 40.3 135.8 162
Current 2 2 23 24 180 212
Previous 8 8 50 60 164 198
Jul 22 5 5 58 66 0 0
Jul 21 8 9 54 67 160 187
Jul 20 5 6 42 53 241 275
Jul 19 5 8 0 0 98 111
Jul 18 0 0 32 37 0 0
Jul 17 7 8 34 41 153 197
Jul 16 8 9 46 55 173 210
Jul 15 8 10 0 0 189 230
Highest 44 56 169 209 674 794


Script Execution Time: 0.94485 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2