I don't see an error in your code, it just that you need to keep following the instructions, by giving the current code i can see its working, take a look at this Codesandbox
If you notice, when you click the button, it tell us Metamask is installed
Few points.
On the documentation, they load this when the window load window.addEventListener('DOMContentLoaded', initialize); and you want to do it on a button, see onclick="initialize()"
Also please make sure for other questions to provide an error or something so the community can help you better
发布评论
评论(1)
我看不到代码中的错误,只是您需要按照说明,通过给出当前代码,我可以看到它的工作,请查看此codesandbox
https://codesandbox.io/s/kind-frost-f4zgd7?file=/index.htex.html
如果您注意到,单击按钮时,它告诉我们MetAmask已安装了
几个点。
window.addeventlistener('domcontentloaded',initialize);
时加载了此功能,然后您想在按钮上执行此操作,请参阅onclick onclick =“ prinitialize()”
还请确保其他问题提供错误或其他问题,以便社区可以帮助您更好
I don't see an error in your code, it just that you need to keep following the instructions, by giving the current code i can see its working, take a look at this Codesandbox
https://codesandbox.io/s/kind-frost-f4zgd7?file=/index.html
If you notice, when you click the button, it tell us Metamask is installed
Few points.
window.addEventListener('DOMContentLoaded', initialize);
and you want to do it on a button, seeonclick="initialize()"
Also please make sure for other questions to provide an error or something so the community can help you better