HOme Sheriff And Lamp
Dependencies: CameraC328 HCSR04 SDFileSystem WIZnetInterface mbed
Fork of HoSAL by
html/image.html@13:cefc034543a5, 2015-08-13 (annotated)
- Committer:
- uasonice
- Date:
- Thu Aug 13 19:35:01 2015 +0000
- Revision:
- 13:cefc034543a5
update: web server image view
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uasonice | 13:cefc034543a5 | 1 | <!DOCTYPE html> |
uasonice | 13:cefc034543a5 | 2 | <html xmlns='http://www.w3.org/1999/xhtml'> |
uasonice | 13:cefc034543a5 | 3 | <head> |
uasonice | 13:cefc034543a5 | 4 | <title>image</title> |
uasonice | 13:cefc034543a5 | 5 | <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> |
uasonice | 13:cefc034543a5 | 6 | <meta http-equiv='pragma' content='no-cache' /> |
uasonice | 13:cefc034543a5 | 7 | <meta http-equiv='content-type' content='no-cache, must-revalidate' /> |
uasonice | 13:cefc034543a5 | 8 | <style> |
uasonice | 13:cefc034543a5 | 9 | body{background-color:transparent;} |
uasonice | 13:cefc034543a5 | 10 | </style> |
uasonice | 13:cefc034543a5 | 11 | |
uasonice | 13:cefc034543a5 | 12 | <script> |
uasonice | 13:cefc034543a5 | 13 | function AJAX(url, callback) |
uasonice | 13:cefc034543a5 | 14 | { |
uasonice | 13:cefc034543a5 | 15 | var req = AJAX_init(); |
uasonice | 13:cefc034543a5 | 16 | req.onreadystatechange = AJAX_processRequest; |
uasonice | 13:cefc034543a5 | 17 | |
uasonice | 13:cefc034543a5 | 18 | function AJAX_init() { |
uasonice | 13:cefc034543a5 | 19 | if (window.XMLHttpRequest) { |
uasonice | 13:cefc034543a5 | 20 | return new XMLHttpRequest(); |
uasonice | 13:cefc034543a5 | 21 | } else if (window.ActiveXObject) { |
uasonice | 13:cefc034543a5 | 22 | return new ActiveXObject('Microsoft.XMLHTTP'); |
uasonice | 13:cefc034543a5 | 23 | } |
uasonice | 13:cefc034543a5 | 24 | }; |
uasonice | 13:cefc034543a5 | 25 | |
uasonice | 13:cefc034543a5 | 26 | function AJAX_processRequest() { |
uasonice | 13:cefc034543a5 | 27 | if(req.readyState == 4) { |
uasonice | 13:cefc034543a5 | 28 | if(req.status == 200) { |
uasonice | 13:cefc034543a5 | 29 | if(callback) |
uasonice | 13:cefc034543a5 | 30 | callback(req.responseText); |
uasonice | 13:cefc034543a5 | 31 | } |
uasonice | 13:cefc034543a5 | 32 | } |
uasonice | 13:cefc034543a5 | 33 | }; |
uasonice | 13:cefc034543a5 | 34 | |
uasonice | 13:cefc034543a5 | 35 | this.doGet = function() { |
uasonice | 13:cefc034543a5 | 36 | req.open('GET', url, true); |
uasonice | 13:cefc034543a5 | 37 | req.send(null); |
uasonice | 13:cefc034543a5 | 38 | }; |
uasonice | 13:cefc034543a5 | 39 | |
uasonice | 13:cefc034543a5 | 40 | this.doPost = function(body) { |
uasonice | 13:cefc034543a5 | 41 | req.open('POST', url, true); |
uasonice | 13:cefc034543a5 | 42 | req.setRequestHeader('Content-Type', |
uasonice | 13:cefc034543a5 | 43 | 'application/x-www-form-urlencoded'); |
uasonice | 13:cefc034543a5 | 44 | req.setRequestHeader('ISAJAX','yes'); |
uasonice | 13:cefc034543a5 | 45 | req.send(body); |
uasonice | 13:cefc034543a5 | 46 | }; |
uasonice | 13:cefc034543a5 | 47 | }; |
uasonice | 13:cefc034543a5 | 48 | |
uasonice | 13:cefc034543a5 | 49 | function $(id){return document.getElementById(id);} |
uasonice | 13:cefc034543a5 | 50 | function $$(id){return document.getElementsByName(id);} |
uasonice | 13:cefc034543a5 | 51 | function $$_ie(tag, name){ |
uasonice | 13:cefc034543a5 | 52 | if(!tag){tag='*';} |
uasonice | 13:cefc034543a5 | 53 | var elems=document.getElementsByTagName(tag); |
uasonice | 13:cefc034543a5 | 54 | var res=[]; |
uasonice | 13:cefc034543a5 | 55 | for(var i=0;i<elems.length;i++){ |
uasonice | 13:cefc034543a5 | 56 | att=elems[i].getAttribute('name'); |
uasonice | 13:cefc034543a5 | 57 | if(att==name){ |
uasonice | 13:cefc034543a5 | 58 | res.push(elems[i]); |
uasonice | 13:cefc034543a5 | 59 | } |
uasonice | 13:cefc034543a5 | 60 | } |
uasonice | 13:cefc034543a5 | 61 | return res; |
uasonice | 13:cefc034543a5 | 62 | } |
uasonice | 13:cefc034543a5 | 63 | |
uasonice | 13:cefc034543a5 | 64 | </script> |
uasonice | 13:cefc034543a5 | 65 | |
uasonice | 13:cefc034543a5 | 66 | <script> |
uasonice | 13:cefc034543a5 | 67 | function load() { |
uasonice | 13:cefc034543a5 | 68 | strFile= window.location.search.substring(1); |
uasonice | 13:cefc034543a5 | 69 | $('imgFile').src = strFile; |
uasonice | 13:cefc034543a5 | 70 | } |
uasonice | 13:cefc034543a5 | 71 | </script> |
uasonice | 13:cefc034543a5 | 72 | |
uasonice | 13:cefc034543a5 | 73 | |
uasonice | 13:cefc034543a5 | 74 | </head> |
uasonice | 13:cefc034543a5 | 75 | <body onload="load()"> |
uasonice | 13:cefc034543a5 | 76 | <img id='imgFile'> |
uasonice | 13:cefc034543a5 | 77 | |
uasonice | 13:cefc034543a5 | 78 | </body> |
uasonice | 13:cefc034543a5 | 79 | </html> |
uasonice | 13:cefc034543a5 | 80 |