Like Brett mentioned, this can't be done without doing some kind of XMLHttpRequest, e.g. jQuery.ajax() or whatever equivalent in your JS framework of choice. You'll have this sitting in a setTimeout loop polling as long as the page is up.
From there you'll have to make some HTTP backend script (perl, or whatever) that returns a JSON string of the file list every time it's called by said XMLHttpRequest. The callback fired after said XHR succeeds then decodes this JSON into an array (can be done automatically in jQuery, otherwise use JSON.parse()). You can tell which files are new (or gone) by getting the disjunction of the lists. You would then likely add an <img> node somewhere in your player with your new images (and whack the gone ones), or if you don't care about interrupting the user, just reload the page via window.location.reload(). If it's a cross-domain request, be-ware that you'll either have to do JSONP or learn about CORS (which may finally work these days). Also remember to not load mixed (insecure) content if the page is SSL. GSB On Mon, 2016-03-07 at 12:08 -0600, Fraser Baker via Houston wrote: > my latest project. I am trying to accommodate > the situation when a client uploads a new image to the disk the > player > will reset so as to include the new image. So what I am considering > is > to use Perl to determine the number of images and cause the viewer to > reset when the number of images has changed. I am assuming this can be > a > call to a Perl script that determines the number of images without > interrupting the viewer and sends a JavaScript call back to the > viewer > to reset when the number of images has changed.
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Houston mailing list [email protected] http://mail.pm.org/mailman/listinfo/houston Website: http://houston.pm.org/
