diff options
various things
Diffstat (limited to 'library/example/index.js')
-rw-r--r-- | library/example/index.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/example/index.js b/library/example/index.js index bdde2b47f..91d2237c2 100644 --- a/library/example/index.js +++ b/library/example/index.js @@ -5,24 +5,24 @@ function web3Detect() { if (global.web3) { document.body.innerHTML += 'web3 detected!' console.log('web3 detected!') + startApp() } else { document.body.innerHTML += 'no web3 detected!' console.log('no web3 detected!') } - startApp() } -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') + var primaryAccount = null + console.log('getting main account...') + web3.eth.getAccounts(function(err, addresses){ + if (err) throw err + console.log('set address') + primaryAccount = addresses[0] + }) + document.querySelector('.action-button-1').addEventListener('click', function(){ console.log('saw click') console.log('sending tx') |