Hi guys! I'm fairly new to Ajax and I'm currently starting practicing the basics. I know the following code I'm gonna be posting isn't the best practice, but its gets me started. This basic code takes up a parameter from a link, the the ajax_script.php does some processing, and returns a text that will be displayed in a <div>. fairly simple, so I want to move to the next level...

1. when the link is clicked.. i want to have the <div> to display this image that denotes "loading", how will i do this?

2. Also, i want my div to expand (transition). Starting from a non-viewable to a box with lets say50px height..

var http = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");

function RTAction(action) {
    http.open('get', 'ajax_script.php?action='+action);
    http.onreadystatechange = handleResponse;

function handleResponse() {
	if(http.readyState==4 && http.status==200){
		var data = http.responseText;
		var container = new Array();
		container = data.split('`');
		document.getElementById(container[0]).innerHTML = container[1];

i know this is possible, but with all the Ajax tutorials out there that aren't friendly enough for me, i need help with this level..

thanks everyone!