jquery - Automatically reload a page after uploading a file -
following answers on post able produce satisfactory job. it's perfect. i'm trying make kind of warning panel loading news txt
file on dropbox public folder. update file , content shown on page.
i have 2 files produce result. important codes are:
pag01.html
load file avisos.html
use format contents data file containing updated news.
<div id="quadro" class="avisos"> <script> var url = 'https://dl.dropbox.com/u/42709342/avisos.html'; // 3. ok got data function afterreadfromdropbox(data) { $('#quadro').html(data); } // 2. ok document ready, lets grab data dropbox function whendocumentisready(){ $.get(url, afterreadfromdropbox ); } // 1. when document ready make call $(document).ready( whendocumentisready ); </script> </div>
avisos.html
just load data file avisos
dropbox public folder.
<div id="avisosmsg" class="avisosmsg"> <script> var url = 'https://dl.dropbox.com/u/42709342/avisos'; // 3. ok got data function afterreadfromdropbox(data) { $('#avisosmsg').html(data); } // 2. ok document ready, lets grab data dropbox function whendocumentisready(){ $.get(url, afterreadfromdropbox ); } // 1. when document ready make call $(document).ready( whendocumentisready ); </script> </div>
during tests use tag
<meta http-equiv="refresh" content=2; url="pag01.html">
to reload page automatically , avoid pressing f5 lot of times.
so here question: how code reload automatically every time upload new version of data file dropbox. possible kind of standby procedure?
ps: i'm having problem encoding can see on image below showing part of page warning panel.
Comments
Post a Comment