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

186
Visualizações
Can't import AlertifyJS in JavaScript

When importing AlertifyJS, I am able to successfully use script tags in the HTML like this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/AlertifyJS/1.13.1/alertify.min.js"></script>

But if I move the import into JS using import * as alertify from './AlertifyJS'; I can't get my project to recognise the library. But everything I have read says this should work, am I doing something wrong?

I have also tried other examples like;

import alertifyjs from 'alertifyjs';

import * as alertify from 'alertify.js';

var alertify = require('alertifyjs');

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can't export JS from HTML. You can import it however, using the type="module" attribute on the tag:

    <script type="module">
        import alertifyjs from 'alertifyjs';

        alertifyjs.myAlert("Browser dialogs made easy!");
    </script>
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