diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-13 11:21:51 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-13 11:21:51 +0800 |
commit | d99fea2db682c454581e1f9f60b2cea27d02c36e (patch) | |
tree | 8eeba254916efb243f4eb63986f7d258bf793854 /example | |
parent | 7ce63d32b287738cd5803c589d3c921aa349346c (diff) | |
download | go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.tar go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.tar.gz go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.tar.bz2 go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.tar.lz go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.tar.xz go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.tar.zst go-tangerine-d99fea2db682c454581e1f9f60b2cea27d02c36e.zip |
abi output formatting
Diffstat (limited to 'example')
-rw-r--r-- | example/index.html | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/example/index.html b/example/index.html index 17694cbf6..dc507ec9c 100644 --- a/example/index.html +++ b/example/index.html @@ -6,39 +6,32 @@ <script type="text/javascript" src="../dist/ethereum.js"></script> <script type="text/javascript"> -if (window.Promise === undefined) { - window.Promise = ES6Promise.Promise; -} - -var web3 = require('web3'); - -//web3.setProvider(new web3.providers.QtProvider()); -//web3.setProvider(new web3.providers.HttpRpcProvider("http://localhost:8080")); -// web3.setProvider(new web3.providers.WebSocketProvider("ws://localhost:40404/eth")); -web3.setProvider(new web3.providers.AutoProvider()); - -function testSnippet() { - web3.eth.watch({altered: web3.eth.coinbase}).changed(function() { - web3.eth.balanceAt(web3.eth.coinbase).then(function (balance) { - console.log(parseInt(balance,16)); - console.log(typeof balance); - document.getElementById("result").innerText = +balance; + if (window.Promise === undefined) { + window.Promise = ES6Promise.Promise; + } + + var web3 = require('web3'); + web3.setProvider(new web3.providers.AutoProvider()); + + function testSnippet() { + web3.eth.watch({altered: web3.eth.coinbase}).changed(function() { + web3.eth.balanceAt(web3.eth.coinbase).then(function (balance) { + console.log(parseInt(balance,16)); + console.log(typeof balance); + document.getElementById("result").innerText = +balance; + }); }); - }); -} - -</script> + } + </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> - + <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> + |