Hello all,
Is there a way in which I can see if a file size is different after 500 milliseconds and if it is refresh the page? And this part isn't PHP but javascript, is there a way I can scroll an iframe to the bottom of its self?
Printable View
Hello all,
Is there a way in which I can see if a file size is different after 500 milliseconds and if it is refresh the page? And this part isn't PHP but javascript, is there a way I can scroll an iframe to the bottom of its self?
Javascript can't access the file system so the only way I know of doing it is to use AJAX (which is esentially javascript) to send a request to a server side script like PHP to check the file size. If the file size has changed the server side script returns true to the ajax function otherwise it returns false.
If the ajax function receives a 'true' response then you can use javascript to reload the web page.
You can use setInterval() function to send the ajax request at set intervals. But 500 milliseconds is pretty short and you might have problems with a second ajax reqiest being sent to the server before the previous one has completed.
Ive always known that javascript can't access the file system, but PHP can and all the PHP would have to do (I think) is get the filesize and use the echo function to make it into a javascript variable. P.S. I DO NOT know a single thing about Ajax
php doesn't auto-refresh, you do have to use ajax. Look it up.