Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda