Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

193
Visualizações
Trying to create a connect metamask feature

I cannot for the life of me figure out what I am doing wrong. I am following the metamask docs and everything: https://docs.metamask.io/guide/create-dapp.html#basic-action-part-1

.html button:

 <!DOCTYPE hmtl>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width-device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" >
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://cdn.jsdlivr.net/npm/web3@latest/dist/web3.min.js"></script>

    <script src="./javafilename.js"></script>
</head>
<body>
    <button class="btn btn-primary btn-lg btn-block mb-3" id="connectButton" value="Connect" enabled></button>
<body>
</html>

metamask java:

const initialize = () => {
    //Basic Actions Section
    const onboardButton = document.getElementById('connectButton');
  };
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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.

  • 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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda