-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (33 loc) · 731 Bytes
/
index.html
File metadata and controls
37 lines (33 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!doctype>
<html>
<head>
<script type='text/javascript'>
function get() {
var param = document.getElementById('query').value;
var res = contracts['Sample'].contract.get();
document.getElementById('queryres').innerText = res;
}
function set() {
var key = document.getElementById('key').value;
var res = contracts['Sample'].contract.set(key);
}
window.onload = function() {
var accounts = web3.eth.accounts;
console.log(accounts);
}
</script>
</head>
<body bgcolor='#E6E6FA'>
<h3>Sample Ratings</h3>
<div>
Store:
<input type='number' id='key'>
<button onclick='set()'>Save</button>
</div>
<div>
Query:
<input value='get' type='button' id='query' onclick='get()' />
<div id='queryres'></div>
</div>
</body>
</html>