aboutsummaryrefslogtreecommitdiffstats
path: root/index.html
blob: 8937993c5f1cc2cd9fb9f9e5dc600e4e4dc63aff (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
34
35
36
37
38
39
40
<!doctype>
<html>

<head>
<script type="text/javascript" src="es6-promise-2.0.0.js"></script>
<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="httprpc.js"></script>
<script type="text/javascript">
if (window.Promise === undefined) {
    window.Promise = ES6Promise.Promise;
}

//web3.setProvider(new web3.providers.QtProvider());
web3.setProvider(new web3.providers.HttpRpcProvider("http://localhost:8080"));

function testSnippet() {
    web3.eth.watch({altered: web3.eth.coinbase}).changed(function() {
        web3.eth.balanceAt(web3.eth.coinbase).then(function (balance) {
            document.getElementById("result").innerText = web3.toDecimal(balance);
        });
    });
}

</script>
</head>

<body>

<h1>std::name_reg</h1>
<input type="text" id="name"></input>
<button type="button" onClick="testSnippet();">test snippet</button>

<div></div>
result: <div id="result"></div>

</body>

</html>