Are you looking for something in AJAX or just something with the loading image in general. If you were using AJAX, here is a simple code snippet that you can use:
(Place between the <head> tags):
Code:
<script type="text/javascript">
var url = "test.php";
var XMLHttpRequestObject = false;
if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp");
}
if(XMLHttpRequestObject) {
var obj = document.getElementById("div-id-here");
XMLHttpRequestObject.open("GET", url);
XMLHttpRequestObject.onreadystatechange = function()
{
if (XMLHttpRequestObject.readyState == 4 &&
XMLHttpRequestObject.status == 200) {
obj.innerHTML = XMLHttpRequestObject.responseText;
}
else {
obj.innerHTML = '<img src="loading.gif"> Loading';
}
}
XMLHttpRequestObject.send(null);
}
</script>
test.php:
Code:
<?php
echo 'Hello World!';
?>
and loading.gif is attached below.
Hope this helps.
EDIT: You can get more animated "loading" images by going to AJAXload.info
Bookmarks