DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. JavaScript
  4. Alertify.js: Pretty Cool

Alertify.js: Pretty Cool

Swizec Teller user avatar by
Swizec Teller
·
Dec. 04, 12 · Interview
Like (1)
Save
Tweet
Share
10.16K Views

Join the DZone community and get the full member experience.

Join For Free
alertify.js

sometimes you come across a library so full of promise and amazingness that you have to write about it before even trying it out.

alertify.js is a javascript library that brings alert() and prompt() into the web world of 2012. no longer will you be forced to use some arcane instruction full of ugly windows and so terribly un-new it sends chills down your spine just thinking about using it.

really … was anyone still using that for anything other than debugging? besides porn phishing sites i mean.

the old alert()

the old alert()

the difference between old way and new is realy quite amazing. while a normal alert() creates a whole new window and blocks javascript execution, alertify’s alert box is a lot easier on the eye, rolls nicely down from the top of the window and most of all is customisable.

although blocking execution would actually be kind of useful, alertify.js can fake this with careful use of callback soup and apparently manages to do something to at least prevent clicking on the page. so unless you get an event from a timer or a socket, you can rest assured nothing will happen while the alert is displayed.

it also plays nice with us keyboard maniacs – you can use the esc key to make a prompt or confirm dialog go away.

another feature i really like are the logging facilities. it’s a log you actually won’t mind showing to your users! wonderful.

log messages

log messages

then again, for debugging i will probably still be using console.log and ruining my sites for all internet explorer users when i forget to remove debugging lines … with alertify.js it’s at least impossible to forget.

oh and another cool thing, fabien doiron implemented the whole thing without jquery , which i think is just impressive, these days i probably can’t do anything without jquery anymore …

JavaScript library Execution (computing) IT JQuery Blocks Impressive (presentation program) Dialog (software) Blocking (computing) Event

Published at DZone with permission of Swizec Teller, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ChatGPT: The Unexpected API Test Automation Help
  • Express Hibernate Queries as Type-Safe Java Streams
  • How to Secure Your CI/CD Pipeline
  • A Brief Overview of the Spring Cloud Framework

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: