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 Quote 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 Quote 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! Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/51378-loading-graphic-while-executing/#findComment-253446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.