Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

$("#mischacam").attr("src", camURL + "/snapshot.cgi?_=" + Math.random());

Out of curiosity, why do you append a random number between 0 and 1 to the URL?




mannix is right; to get the browser to reload the image I have to change the url every time. You'd think in a well-designed webcam API the image would come back with appropriate headers to prevent caching, but I didn't even bother to check. The webcam software is not well-designed.


Probably to bust possible caching.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: