Hey guys,
I've just recently started getting my feet wet with Ajax and have a quick question. It seems like it should be fairly simple so hopefully someone can help.
I have this function that loads dynamic content into a div element:
The xmlhttp object is an ajax object created elsewhere in the code.Code:function makerequest(serverPage, objID) { var obj = document.getElementById(objID); xmlhttp.open("GET", serverPage); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); }
Basically what I am wanting to do is modify this so that while it's waiting for the external page to load it displays a standard style loading gif in the destination div element.
I've been programming php for a long time so I have an idea of how I would do it in php, but I've unfortunately neglected javascript so the syntax is still somewhat foreign to me, (although I'm learning more everyday).
Anyway if someone could help that would be great.
thanks,
Chris



).


Bookmarks