Wednesday, November 30, 2016

Sweet Alert JS library - beautiful replacement of JavaScript Alert



You may think JS alert is boring and less flexible. You can use Sweet Alert. You can download and see the demo of sweet alert from:
http://t4t5.github.io/sweetalert/
Then initialize the plugin by referencing the necessary files (js and css):
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="sweetalert.css">
Example 1: error message:
sweetAlert("Not Allowed", "Average of Chair's Recommended Step  exceeds 1.25!", "error"); 

result:
Example 2: error message:
                    sweetAlert({
                            title:" Are you sure?",
                            text:"You will not be able to edit.",
                            type:"warning",
                            showCancelButton:true,
                            confirmButtonClass: "btn-danger",
                            confirmButtonText: "Yes, Submit & Lock",
                            confirmButtonColor: "#DD6B55",
                            cancelButtonText: "Cancel",
                            closeOnConfirm: true,
                            closeOnCancel:true
                    },
                    function(response){
                            if(response == true){
                           
                            }else{
                                   
                            }
                    });


result:

12 comments:

  1. Learning new technolgy would help oneself at hard part of their career. And staying updated is the only way to survive in current position. Your content tells the same. Thanks for sharing this information in here. Keep blogging like this.
    PHP Training in Chennai

    ReplyDelete
  2. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..

    Car Wash Services in Mumbai

    ReplyDelete
  3. Usually I do not read post on blogs, but I would like to say that this write-up very forced me to try and do it! Your writing style has been surprised me. Great work admin.Keep update more blog.
    GMAT coaching chennai

    ReplyDelete
  4. well and nice tips about web culture. it really good for everything should know before to reach a target. keep update more updates about web info. thanks.
    Best CAT Coaching in Chennai

    ReplyDelete
  5. This was so useful and informative. The article helped me to learn something new. Android Training in Chennai

    ReplyDelete
  6. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting

    for your next post keep on updating these kinds of knowledgeable things...
    Texting API
    Text message marketing
    Digital Mobile Marketing
    Mobile Marketing Services
    Mobile marketing companies
    Fitness SMS

    ReplyDelete
  7. It was simply amazing and very useful,Your explaination is really nice.I was very glad to see this wonderful blog,thanks for this useful and intrested blog.keep posting!
    amazon web services aws training in chennai

    microsoft azure training in chennai

    workday training in chennai

    android-training-in chennai

    ios training in chennai

    ReplyDelete
  8. Very great post. I just discovered your blog and needed to state that I have truly appreciated perusing your blog entries. Any way I'll be buying in to your feed and I trust you post again soon.
    data scientist course in hyderabad

    ReplyDelete
  9. Online Casino UK | Review, Offers, Bonuses | LACbet
    Bet 온라인카지노 at LACbet and enjoy exclusive matchpoint sports betting offers including enhanced odds for all major sports 퍼스트 카지노 events. Bet online today and enjoy the latest

    ReplyDelete