|
Posted by Eric on 05/19/06 21:00
Martin Jay wrote:
> In message <IOqdnZwCTY41ZvDZRVn-pw@comcast.com>, Eric <nospam@email.com>
> writes
>>Martin Jay wrote:
>
>>> From the PHP manual:
>>>
>>> <?php
>>> $filename = '/path/to/foo.txt';
>>>
>>> if (file_exists($filename)) {
>>> echo "The file $filename exists";
>>> } else {
>>> echo "The file $filename does not exist";
>>> }
>>> ?>
>
>>How do i do that from javascript? Can i call it somehow? I'm in a
>>javascript loop looking at a series of files, and if one is missing i need
>>to break out of the loop early.
>
> Perhaps you should give us the full picture so we know what you're
> trying to achieve.
>
> The answer to: "Is it possible to check for existence of a file from a
> web page using javascript?" is probably no. But there may be another
> solution. Are you able to run scripts on your web server?
Ok, I've got some javascript code that loads images in a loop for a
slideshow. The images are gathered from a web cam, 1 each 5 minutes so
that i hae a history going back 2 days (This isnt published by the way its
only for my use "at this time", i may put it public later - not sure yet)
Anyway, its entirely possible that out of the 576 possible images that
something changed and maybe only images 1 to 297 (or whaever number you
like) are currently there.
So, in my javascript loop before i try to load a slide image, i wanted to
see if the pic was actualy there and if not I'd stop loading images, break
out of the loop, and just proceed on with the reduced set
Thanks
Eric
Navigation:
[Reply to this message]
|