Dynamic Ajax content
http://www.dynamicdrive.com/dynamici...jaxcontent.htm
How can i add a waiting message while the page is loading ?
I wont just to display and hidding a hidden DIV
Thanks alot !
Dynamic Ajax content
http://www.dynamicdrive.com/dynamici...jaxcontent.htm
How can i add a waiting message while the page is loading ?
I wont just to display and hidding a hidden DIV
Thanks alot !
Just find the lines:
and add beneath it something like:Code:page_request.onreadystatechange=function(){ loadpage(page_request, containerid) }
Code:page_request.onreadystatechange=function(){ loadpage(page_request, containerid) } document.getElementById(containerid).innerHTML='<b>Loading Content. Please hold...</b>'
Thanks !![]()
hello, I have added this code to my dynamic content script and I was wondering if there is a way to make it stay for say 1-2 seconds before the page loads? At the minute my pages are small so the loader flashes up for a millisecond, it would be nice for it to stay there so the user actually sees it.
Thank you
Helen
Sure, try finding the following function inside the script:
Code:function loadpage(page_request, containerid){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) document.getElementById(containerid).innerHTML=page_request.responseText }
and replace it with:
1000 in the above denotes 1 second (1000 milliseconds).Code:function loadpage(page_request, containerid){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){ if (typeof ajaxcontent_loadtimer!="undefined") clearTimeout(ajaxcontent_loadtimer) ajaxcontent_loadtimer=setTimeout(function(){document.getElementById(containerid).innerHTML=page_request.responseText}, 1000) } }
DD Admin
helenmarie123 (09-28-2010)
thats ace thank you very much![]()
Bookmarks