stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I've been doing some work with CGI::AJAX, and I stumbled upon a tutorial about AJAX loading screens using the javascript code below:
<script type="text/javascript"> function init () { $('submit').onclick = function () { sendData(); } } function sendData () { var url = 'process.php'; var pars = Form.serialize('frm'); var myAjax = new Ajax.Request( url, {method: 'get', parameters: pa +rs, onLoading: showLoad, onComplete: showResponse} ); } function showLoad () { $('load').style.display = 'block'; } function showResponse (originalRequest) { var newData = originalRequest.responseText; $('load').style.display = 'none'; $('status').innerHTML = newData; } </script> </head> <body onload="init()"> <div id="load" style="display:none">loading...</div> <div id="status"></div>
Any thoughts?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::AJAX loading screen?
by bart (Canon) on Mar 10, 2007 at 07:50 UTC | |
by hpavc (Acolyte) on May 18, 2007 at 15:50 UTC | |
by bart (Canon) on May 18, 2007 at 16:27 UTC | |
|
Re: CGI::AJAX loading screen?
by erroneousBollock (Curate) on Mar 10, 2007 at 07:03 UTC | |
by stonecolddevin (Parson) on Mar 10, 2007 at 19:24 UTC |