【发布时间】:2019-09-30 02:39:13
【问题描述】:
我正在使用浏览器。我有 node.js 文件如下:
const Web3 = require('web3');
const web3 = new Web3('https://kovan.infura.io');
window.onload = function () {
web3.eth.getBalance('0x9E632F36D8193a23ee76e7C14698aCF4b92869A2').then(console.log)
document.getElementById("sc_bal").innerHTML=web3.eth.getBalance('0x9E632F36D8193a23ee76e7C14698aCF4b92869A2');
};
我想在 HTML div 元素中显示智能合约地址。如果我控制它显示输出的值,但如果我将值与 div 元素绑定,那么它显示为
[对象承诺]
谁能帮我解决这个问题?
【问题讨论】:
-
感谢链接。
标签: javascript node.js html browserify web3