SHOW:
|
|
- or go back to the newest paste.
1 | - | <head> |
1 | + | <head> |
2 | - | <title>API</title> |
2 | + | <title>API</title> |
3 | - | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> |
3 | + | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> |
4 | - | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> |
4 | + | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> |
5 | - | <script type="text/javascript" charset="utf-8"> |
5 | + | <script type="text/javascript" charset="utf-8"> |
6 | - | function saveData(){ |
6 | + | function saveData(){ |
7 | - | $.post("/device",{deviceuid: $("#deviceuid").val()}) |
7 | + | $.post("/getimage",{inputtext: $("#inputtext").val()}) |
8 | - | .done(function(data){ |
8 | + | .done(function(d)){ |
9 | - | alert(data); //you will get images name here |
9 | + | alert(d); //you will get images name here |
10 | - | }); |
10 | + | |
11 | - | } |
11 | + | //var temp="'/static/images/"+d[0]+"'"; |
12 | - | </script> |
12 | + | //document.getElementById("gen").src=temp; |
13 | - | </script> |
13 | + | } |
14 | - | <style> |
14 | + | } |
15 | - | .centered{ |
15 | + | </script> |
16 | - | float: none; |
16 | + | </script> |
17 | - | margin: 0 auto; |
17 | + | <style> |
18 | - | } |
18 | + | .centered{ |
19 | - | </style> |
19 | + | float: none; |
20 | - | </head> |
20 | + | margin: 0 auto; |
21 | - | <body> |
21 | + | } |
22 | - | <body> |
22 | + | </style> |
23 | - | <div class="container"> |
23 | + | </head> |
24 | - | <div class="col-lg-8 centered"> |
24 | + | <body> |
25 | - | <center> |
25 | + | <body> |
26 | - | <h3>Device Record</h3> |
26 | + | <div class="container"> |
27 | - | </center> |
27 | + | <div class="col-lg-8 centered"> |
28 | - | <div class="well" id="log"> |
28 | + | <center> |
29 | - | <h4>deviceuid</h4><input type="text" class="form-control input-sm" id="deviceuid"> |
29 | + | <h3>Device Record</h3> |
30 | - | <button type="button" class="btn btn-success" onclick="saveData()">Save</button> |
30 | + | </center> |
31 | - | </div> |
31 | + | <div class="well" id="log"> |
32 | - | <center> |
32 | + | <h4>deviceuid</h4><input type="text" class="inputtext" id="inputtext"> |
33 | - | <h3>Transaction Record</h3> |
33 | + | <button type="button" class="btn btn-success" onclick="saveData()">Submit</button> |
34 | - | </center> |
34 | + | </div> |
35 | - | </div> |
35 | + | <center> |
36 | - | </div> |
36 | + | <h3>Transaction Record</h3> |
37 | - | </body> |
37 | + | <img id="gen"></br> |
38 | - | </body> |
38 | + | |
39 | - | </html> |
39 | + | </center> |
40 | </div> | |
41 | </div> | |
42 | </body> | |
43 | </body> | |
44 | </html> |