Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (25 sloc) 706 Bytes
<!DOCTYPE html>
<html>
<head>
<title>Raspberry camera live picture</title>
<script>
var askpic=function(){
var r = new XMLHttpRequest();
r.open("GET", "/take_photo", true);
r.onreadystatechange = function () {
if (r.readyState != 4 || r.status != 200) return;
document.getElementById('livepicture').innerHTML='<img src="static/'+JSON.parse(r.response).filename+'" alt="live image" />';
document.getElementById('loadmsg').innerHTML="Picture took! Loading...";
};
r.send();
document.getElementById('loadmsg').innerHTML="Smile! Taking picture...";
};
window.onload=askpic;
setInterval(askpic,60);
</script>
</head>
<body>
<span id="loadmsg"></span>
<div id="livepicture"></div>
</body>
</html>
You can’t perform that action at this time.