add a loading image

Hello,

i’m using a currency widget found here : http://kabo.nu/currency_widget/

and here is the jscript : http://kabo.nu/currency_widget/currency_widget/js/jquery.currency_widget.js

Can someone help me to add a loading image to be displayed from the moment of submit to result.

$.ajaxSetup ({
                cache: false
            });
           
            var ajax_load = "<img class='loading' src='img/load.gif' alt='loading...' />";
$("#result")
                   
.html(ajax_load)

Hi,

You can use blockui plugin for this-

http://delicious.com/anupdg/blockui

Hai,

See if this can solve.

Have a div in your page

<div id="busyIcon">
  <img src="images/loading.gif" alt="loading" />
</div>

Style for the div is

visibility: hidden;
position: absolute;
left: 0px;
top: 0px;

Have two javascript functions as

function showBusyIcon()
{
 document.getElementById('busyIcon').style.visibility = "visible";
 document.getElementById('busyIcon').style.display = "block";
}

function HideBusyIcon()
{
 document.getElementById('busyIcon').style.visibility = "hidden";
 document.getElementById('busyIcon').style.display = "none";
}

And call thefunctions in your code as

showBusyIcon();

$.ajax(............

..............

)

hideBusyIcon();

Thanks.

Thanks for your help,

i have to do it using the script here : http://kabo.nu/currency_widget/currency_widget/js/jquery.currency_widget.js

This script generates also the html form. And i’m using razor syntax. How can i add the loading message inside this script?

Leave a Reply