This is a basic motion detector using your web camera to detect motion. For this to work you need a browser supporting .getUserMedia(). It works by sampling the camera feed every 1 second and comparing the latest two images. If the change is big enough it saves the latest image in an img tag. The point is this way it captures the moving thing that triggers it.
For this I remade my image comparison PHP class for HTML5 API using .getUserMedia()
It does not save the images anywhere else, there is no server code included it only runs on client side. You can freely check out the source code.
You have to give permission to your web camera, your browser will ask for it.