Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [JAVASCRIPT]Refresh
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
LazerPhEa
Vendo Steinberger GM7TA

User info:
Registered: Jul 2002
Posts: 4400 (0.51 al dì)
Location: S. Donato Beach
Corso: TICo
Anno: Finito tutto
Time Online: 83 Days, 22:35:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[JAVASCRIPT]Refresh

Ciao a tutti!
Non sono un mastro col javascript, e vorrei sapere se è fattibile la seguente cosa:
sul server ho una directory dove ad intervalli regolari (diciamo 1 secondo) vengono caricate immagini con dei nomi progressivi tipo: "img1", "img2", "img3" ecc... e sul client ho uno script che ad intervalli regolari visualizza le immagini in sequenza, creando una specie di refresh.
Ora: su reti molto lente succede che il "frame" successivo a quello attualmente visualizzato non sia ancora stato trasferito completamente al momento della sua visualizzazione, e mi piazza una bella immagine nera. C'è un modo di subordinare la visualizzazione di un'immagine al suo completo caricamento?

:ciao:

__________________
Questo è il giardino
Dove il principe muore
Nessun sentiero
Nessun destriero
Soltanto un nome... Eterno...

18-02-2005 14:01
Click Here to See the Profile for LazerPhEa Click Here to See the Blog of LazerPhEa Click here to Send LazerPhEa a Private Message Find more posts by LazerPhEa Add LazerPhEa to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Non riesco ad inquadrare bene il tuo problema...

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

18-02-2005 14:12
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: [JAVASCRIPT]Refresh

Originally posted by LazerPhEa
Ciao a tutti!
Non sono un mastro col javascript, e vorrei sapere se è fattibile la seguente cosa:
sul server ho una directory dove ad intervalli regolari (diciamo 1 secondo) vengono caricate immagini con dei nomi progressivi tipo: "img1", "img2", "img3" ecc... e sul client ho uno script che ad intervalli regolari visualizza le immagini in sequenza, creando una specie di refresh.
Ora: su reti molto lente succede che il "frame" successivo a quello attualmente visualizzato non sia ancora stato trasferito completamente al momento della sua visualizzazione, e mi piazza una bella immagine nera. C'è un modo di subordinare la visualizzazione di un'immagine al suo completo caricamento?

:ciao:


Spero di aver capito bene il problema.
L'ideale sarebbe una funzione che ti dice se un file immagine e' integro, prima di caricarlo.
Ma non so se esiste.
Un' alternativa potrebbe consistere nel caricare un' immagine SOLO se esiste il file dell'immagine successiva.
Questo se le carica sequenzialmente.
In questo modo sei sicuro che l'immagine "corrente" e' stata downlodata interamente.


Sempre che abbia capito bene il problema :)

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

18-02-2005 14:18
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ammesso che sia invece un problema di 'caching', io uso questo metodo:

PHP:

<script language="JavaScript">
   if (document.images) {
      var immagine = new Image(x, y);
      immagine.src="http://www.tuosito.it/immagine.gif";
   }
</script>



In questo modo l'immagine viene caricata prima della sua visualizzazione...

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

18-02-2005 14:23
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ripe
Ammesso che sia invece un problema di 'caching', io uso questo metodo:
PHP:

<script language="JavaScript">
   if (document.images) {
      var immagine = new Image(x, y);
      immagine.src="http://www.tuosito.it/immagine.gif";
   }
</script>



In questo modo l'immagine viene caricata prima della sua visualizzazione...


Boh io avevo capito che ha un server in cui vengono messe a intervalli delle immagini con nome progressivo.
Da un client cerca di vederle in ordine come tanti frame.

E avevo capito che il suo problema e' dovuto al fatto che la rete a volte e' un po' lenta e ci sta diversi secondi per mettere completamente il file sul server.
Quindi quando il client prova a visualizzare l'immagine trova un file incompleto e visualizza un "nero".
Questo e' quel che avevo capito io :)

ma visto che non sono un esperto di Javascript io stavo dando una soluzione generale di programmazione :)

Boh :)

Che fa esattamente quel che hai scritto, ripe ?!

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

18-02-2005 14:28
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Crea una copia in memoria dell'immagine da visualizzare, prima che essa venga chiamata nella pagina dal browser...

E' utile ad esempio per precaricare le immagini di un mouse-over, o di una grossa galleria di foto...!

Pensavo che magari potesse fare una prova, pure senza specificare grandezza e larghezza dell'immagine... anche se in questo modo è più veloce!

Se il problema è come l'hai intuito tu (e ad occhio mi sa che hai ragione), credo non ci sia nulla da fare in Javascript...

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

18-02-2005 14:31
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
LazerPhEa
Vendo Steinberger GM7TA

User info:
Registered: Jul 2002
Posts: 4400 (0.51 al dì)
Location: S. Donato Beach
Corso: TICo
Anno: Finito tutto
Time Online: 83 Days, 22:35:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Sìsì!!! Alf, hai capito il mio problema! Forse riesco a cavarmela con un "onerror" e qualche millisecondo di delay!
Però se qualcuno ha idee migliori... ;)

__________________
Questo è il giardino
Dove il principe muore
Nessun sentiero
Nessun destriero
Soltanto un nome... Eterno...

18-02-2005 14:33
Click Here to See the Profile for LazerPhEa Click Here to See the Blog of LazerPhEa Click here to Send LazerPhEa a Private Message Find more posts by LazerPhEa Add LazerPhEa to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by LazerPhEa
Sìsì!!! Alf, hai capito il mio problema! Forse riesco a cavarmela con un "onerror" e qualche millisecondo di delay!
Però se qualcuno ha idee migliori... ;)


onerror ??
Cioe' ?!
Beh se provi a fare come suggerivo semplicemente visualizzi l'immagine quando ha iniziato a scrivere l'altra :)
Se ti serve che siano perfettamente in sincrono ... non so forse sa dirti ripe se esiste un comando che controlla l'integrita' di un file immagine.

Ah ripe ho capito :D

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

18-02-2005 14:50
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 01:57.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.144 seconds (56.68% PHP - 43.32% MySQL) con 24 query.