Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!