alfinsh Posted June 15, 2009 Report Share Posted June 15, 2009 $(document).ready(function(){ load_top15(); }); function load_top15(){ $("top15").html('<img src="/bildes/load_top15.gif" alt="" />').load("/stats/top15.php"); window.setTimeout("load_top15()", 60000); } Kāda gudra galva nevarētu izskaidrot kādēļ pieprasītais php fails nerefrešojas pēs minūtes ? Quote Link to comment Share on other sites More sharing options...
anonīms Posted June 15, 2009 Report Share Posted June 15, 2009 Neesmu js jomā labs, bet vaitad minūte nav 60s nevis 60000? Quote Link to comment Share on other sites More sharing options...
alfinsh Posted June 15, 2009 Author Report Share Posted June 15, 2009 ta ir jabut 60000 ir 1 minute Quote Link to comment Share on other sites More sharing options...
bubu Posted June 15, 2009 Report Share Posted June 15, 2009 Jokains tas javaskripts tev. Tu uz dokumenta ielādi uzreiz izsauc load_top15 funkciju, kurā ielādē to bildi, un tad uzliec taimoutu uz 1 minūti, pēc kura vēlreiz izsauc to load_top15 funkciju, kur atkal ielādē bildi un uzliek taimoutu izsaukt to pašu fju (utt.. bezgalīgais cikls). Es rakstītu šādi: $(document).ready(function() { window.setTimeout(function() { $("top15").html('<img src="/bildes/load_top15.gif" alt="" />').load("/stats/top15.php"); }, 60000); }); anonīms: tur jānorāda milisekundes, nevis sekundes. Quote Link to comment Share on other sites More sharing options...
alfinsh Posted June 15, 2009 Author Report Share Posted June 15, 2009 (edited) itkā nekā nenotiek Edited June 15, 2009 by bubu Lūdzu nevajag taisīt bezjēdzīgas QUOTEs! Quote Link to comment Share on other sites More sharing options...
marcis Posted June 15, 2009 Report Share Posted June 15, 2009 bubu, aiz bildes parādīšanas notiek vēl šis tas :) Loģiski, ka bezgalīgais cikls, ja es ik pēc noteikta laika gribu ielādēt to pašu failu. Ir citi varianti? Quote Link to comment Share on other sites More sharing options...
codez Posted June 15, 2009 Report Share Posted June 15, 2009 $("top15") => $("#top15"). Quote Link to comment Share on other sites More sharing options...
indoom Posted June 16, 2009 Report Share Posted June 16, 2009 (edited) bubu variantā jāizmanto ir setInterval, lai atkārtotos ik pēc minūtes. Bet ir problēma, ka tādā veidā uz document ready netiek palaista tā funkcija, bet tikai pēc minūtes. Edited June 16, 2009 by indoom Quote Link to comment Share on other sites More sharing options...
bubu Posted June 16, 2009 Report Share Posted June 16, 2009 Vai tad autors sākumā neprasīja refrešot pēc minūtes? Ar gaišreģību netaisos nodarboties.. Quote Link to comment Share on other sites More sharing options...
alfinsh Posted June 16, 2009 Author Report Share Posted June 16, 2009 indom pareizi domā :) bubbu , 1 reizi saskaros ar ko šādu ,tādēl piedod ja tevi neievirzīju pareizā domā. Quote Link to comment 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.