diff options
library - basic test server + partial safari fixes
Diffstat (limited to 'library/example')
-rw-r--r-- | library/example/index.html | 2 | ||||
-rw-r--r-- | library/example/index.js | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/library/example/index.html b/library/example/index.html index aa15a4523..47d6da34f 100644 --- a/library/example/index.html +++ b/library/example/index.html @@ -12,6 +12,6 @@ <button class="action-button-1">SYNC TX</button> <button class="action-button-2">ASYNC TX</button> <script src="./zero.js"></script> - <script src="./bundle.js"></script> + <script src="./app.js"></script> </body> </html>
\ No newline at end of file diff --git a/library/example/index.js b/library/example/index.js index d24c26f87..bdde2b47f 100644 --- a/library/example/index.js +++ b/library/example/index.js @@ -4,8 +4,10 @@ window.addEventListener('load', web3Detect) function web3Detect() { if (global.web3) { document.body.innerHTML += 'web3 detected!' + console.log('web3 detected!') } else { document.body.innerHTML += 'no web3 detected!' + console.log('no web3 detected!') } startApp() } @@ -13,12 +15,17 @@ function web3Detect() { var primaryAccount = null web3.eth.getAccounts(function(err, addresses){ if (err) throw err + console.log('set address') primaryAccount = addresses[0] }) function startApp(){ + console.log('app started') + document.querySelector('.action-button-1').addEventListener('click', function(){ + console.log('saw click') + console.log('sending tx') web3.eth.sendTransaction({ from: primaryAccount, value: 0, @@ -28,7 +35,9 @@ function startApp(){ }) }) document.querySelector('.action-button-2').addEventListener('click', function(){ + console.log('saw click') setTimeout(function(){ + console.log('sending tx') web3.eth.sendTransaction({ from: primaryAccount, value: 0, |