envexlabs Posted May 14, 2007 Share Posted May 14, 2007 Hey, I was wondering if there was a way to display a loading graphic until a PHP script has finished executing. Thanks, envex Link to comment https://forums.phpfreaks.com/topic/51378-loading-graphic-while-executing/ Share on other sites More sharing options...
chigley Posted May 14, 2007 Share Posted May 14, 2007 Not really PHP at all but here: <script language="javascript" type="text/javascript"> document.write('<div style="width: 100%; text-align:center;"><img src="loading.gif"></div>'); function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addLoadEvent(function() { document.getElementById("loading").style.display="none"; }); </script> Get some nice loading.gif images at: http://www.ajaxload.info Link to comment https://forums.phpfreaks.com/topic/51378-loading-graphic-while-executing/#findComment-252993 Share on other sites More sharing options...
envexlabs Posted May 14, 2007 Author Share Posted May 14, 2007 Thanks! Link to comment https://forums.phpfreaks.com/topic/51378-loading-graphic-while-executing/#findComment-253009 Share on other sites More sharing options...
chigley Posted May 15, 2007 Share Posted May 15, 2007 No problemo Remember to click solved. Link to comment https://forums.phpfreaks.com/topic/51378-loading-graphic-while-executing/#findComment-253446 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.