[xml:1:2d77db1afb]<div id="progress_info"></div>[/xml:1:2d77db1afb]
W php napisałem funkcję:[php:1:2d77db1afb]<?php
function progress_text($t="")
{
print '<script type="text/javascript" language="JavaScript">' . "n";
print '<!--' . "n";
if(empty($t))
{
print "t" . 'progress_text('<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="center" class="titre1">' . $t . '</td></tr></table>');' . "n";
}else{
print "t" . 'progress_text();' . "n";
}
print '//-->' . "n";
print '</script>' . "n";
@ob_flush();
}
?>[/php:1:2d77db1afb]
i do tego w nagłówku strony dodaję plik z funkcją JS:
Kod
function progress_text(txt)
{
if (!document.layers&&!document.all) return;
if (document.layers)
{
document.layers.progress_info.document.write(txt);
document.layers.progress_info.document.close();
}else if (document.all)
progress_info.innerHTML=txt;
}
{
if (!document.layers&&!document.all) return;
if (document.layers)
{
document.layers.progress_info.document.write(txt);
document.layers.progress_info.document.close();
}else if (document.all)
progress_info.innerHTML=txt;
}
Wywołuje to przez:[php:1:2d77db1afb]<?php
progress_text("Proszę czekać...");
// tu się coś długo wykonuje nic nie wysyłając do przeglądarki
progress_text();
//tu wyświetlam wynik pracy...
?>[/php:1:2d77db1afb]całość działa w MsIE, ale tylko w niej... (no i w konquerorze), ale nie wiem jak zrobić by działało również w np. mozilli... Jeżeli chodzi o JS, to jestem trochę lamerem i nieznam się zbytnio... Czy ktoś mi to może wytłumaczyć i pomóc przerobić? (tego JSa sam nie pisałem, tylko ściągnąłem z jakiejś strony...)