aboutsummaryrefslogtreecommitdiffstats
path: root/index.html
blob: 70f788d0dea8632616fa231296b05027dcb80e73 (plain) (blame)
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
<!doctype>
<html>

<head>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript" src="websocket.js"></script>
<script type="text/javascript" src="qt.js"></script>
<script type="text/javascript" src="http.js"></script>
<script type="text/javascript">
function registerName() {
    var name = document.querySelector("#name").value;
    name = web3.fromAscii(name);

    var eth = web3.eth;
    eth.transact({to: "NameReg", gas: "10000", gasPrice: eth.gasPrice, data: [web3.fromAscii("register"), name]}).then(function(tx) {
        document.querySelector("#result").innerHTML = "Registered name. Please wait for the next block to come through.";
    }, function(err) {
        console.log(err); 
    });
}
</script>
</head>

<body>

<h1>std::name_reg</h1>
<input type="text" id="name"></input>
<input type="submit" onClick="registerName();"></input>
<div id="result"></div>

</body>

</html>