Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 989 Bytes

README.md

File metadata and controls

49 lines (36 loc) · 989 Bytes

AsgarAlert (v1) for JS


Install

<script defer src="/asgar-alert.js"></script>

Examples

The most basic message:

asgar("Hello world!");

A message signaling an error:

asgar("Something went wrong!", "error");

Handling the result of AsgarAlert modal:

asgar({
  title: "Are you sure?",
  message: "Want to log out?",
  details: "You will not able to recover this action",
  left: "Cancel",
  right: "Yes,Iam sure",
})
  .then(() => {
    console.log("right button clicked");
  })
  .catch(() => {
    console.log("left button clicked");
  });

View more examples

Browser compatibility

IE11* Edge Chrome Firefox Safari Opera Android Browser* UC Browser*