Search
 
SCRIPT & CODE EXAMPLE
 

HTML

Sweetalert

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>swal("My title", "My description", "success");</script>
Comment

sweet alert example

swal({
  title: "Good job!",
  text: "You clicked the button!",
  icon: "success",
  button: "Aww yiss!",
});
Comment

sweetalert

Swal.fire({
  position: 'top-end',
  icon: 'success',
  title: 'Your work has been saved',
  showConfirmButton: false,
  timer: 1500
})
Comment

sweetalert example

//import sweetalert
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

//Alert
<script>swal("My title", "My description", "success");</script>
Comment

sweetalert

Swal.fire({
  position: 'top-end',
  icon: 'success',
  title: 'Your work has been saved',
  showConfirmButton: false,
  timer: 1500
})
Comment

success sweet alert

Swal.fire({
  title: 'Custom animation with Animate.css',
  icon: 'success',
  showClass: {
    popup: 'animate__animated animate__fadeInDown'
  },
  hideClass: {
    popup: 'animate__animated animate__fadeOutUp'
  }
})
Comment

bootstrap sweetalert

swal("Good job!", "You clicked the button!", "success")
Comment

sweatalet

swal({  title: "Good job!",  text: "You clicked the button!",  icon: "success",  button: "Aww yiss!",});
Comment

SweetAlert

Swal.fire({
  title: 'هل تريد الاستمرار؟',
  icon: 'question',
  iconHtml: '؟',
  confirmButtonText: 'نعم',
  cancelButtonText: 'لا',
  showCancelButton: true,
  showCloseButton: true
})
Comment

sweetalert

Swal.fire({
  title: 'Custom animation with Animate.css',
  showClass: {
    popup: 'animate__animated animate__fadeInDown'
  },
  hideClass: {
    popup: 'animate__animated animate__fadeOutUp'
  }
})
Comment

sweet alert

Swal.fire({
  title: 'Are you sure?',
  text: "You won't be able to revert this!",
  icon: 'warning',
  showCancelButton: true,
  confirmButtonColor: '#3085d6',
  cancelButtonColor: '#d33',
  confirmButtonText: 'Yes, delete it!'
})
Comment

Sweet alert

Swal.fire({
  title: "<i>Title</i>", 
  html: "Testno  sporocilo za objekt: <b>test</b>",  
  confirmButtonText: "V <u>redu</u>", 
  allowOutsideClick: false,
});
Comment

sweetalert

swal("Good job!", "success");
Comment

sweetalert

Swal.fire({
  imageUrl: 'https://placeholder.pics/svg/300x1500',
  imageHeight: 100,
  imageAlt: 'A tall image'
})
Comment

sweetalert

swal("Good job!", "You clicked the button!", "error");
Comment

Sweet alert

// Add the product name as data argument to Ajax add to cart buttons
add_filter( "woocommerce_loop_add_to_cart_args", "filter_wc_loop_add_to_cart_args", 20, 2 );
function filter_wc_loop_add_to_cart_args( $args, $product ) {
    if ( $product->supports( 'ajax_add_to_cart' ) && $product->is_purchasable() && $product->is_in_stock() ) {
        $args['attributes']['data-product_name'] = $product->get_name();
    }
    return $args;
}

// On Ajax added to cart, shows a lightbox with the product name (and the product id)
add_action( 'wp_footer', 'ajax_added_to_cart_popup_script' );
function ajax_added_to_cart_popup_script() {
    ?>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
    <script type="text/javascript">
    jQuery( function($){
        // On "added_to_cart" live event
        $(document.body).on('added_to_cart', function( a, b, c, d ) {
            var prod_id   = d.data('product_id'), // Get the product name
                prod_qty  = d.data('quantity'), // Get the quantity
                prod_name = d.data('product_name'); // Get the product name

            Swal.fire({
                title: '<?php _e("Added to cart!"); ?>',
                text: prod_name+' ('+prod_id+')',
                showCancelButton: true,
                confirmButtonColor: '#000',
                cancelButtonColor: '#3085d6',
                confirmButtonText: '<?php _e("View-cart"); ?>',
                cancelButtonText:  '<?php _e("Continue shopping"); ?>'
            }).then((result) => {
                if (result.value) {
                    window.location.href = '<?php echo wc_get_cart_url(); ?>';
                }
            });
        });
    });
    </script>
    <?php
}
Comment

sweet alert

swal({
  buttons: ["test", "Do it!"],
});
Comment

sweetalert

swal("Good job!", "You clicked the button!", "success");
Comment

sweetalert jquery

customClass: {
  container: 'havij',
  popup: '...',
  header: '...',
  title: '...',
  closeButton: '...',
  icon: '...',
  image: '...',
  content: '...',
  htmlContainer: '...',
  input: '...',
  inputLabel: '...',
  validationMessage: '...',
  actions: '...',
  confirmButton: '...',
  denyButton: '...',
  cancelButton: '...',
  loader: '...',
  footer: '....',
  timerProgressBar: '....',
}
Comment

sweetalert

swal({  icon: "success",});
Comment

sweetalret

swal({  icon: "success", message: "Error"});
Comment

sweetalert

// reactjs codeto browse and upload an image from your device  
const addImage =async() => {

    const { value: file } = await Swal.fire({
      title: 'Select image',
      input: 'file',
      inputAttributes: {
        'accept': 'image/*',
        'aria-label': 'Upload your profile picture'
      }
    })
    
    if (file) {
      const reader = new FileReader()
      reader.onload = (e) => {
        Swal.fire({
          title: 'Your uploaded picture',
          imageUrl: e.target.result,
          imageAlt: 'The uploaded picture'
        }
        
        )
        console.log(e.target.result);
      }
     
      reader.readAsDataURL(file)
    }
    
Comment

sweet alert

swal("Hello world!");
Comment

sweet alert example

swal("Here's a message!")
Comment

sweetalert

<script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script>
Comment

sweetallert

swal({
  text: "Hello world!",
});
Comment

PREVIOUS NEXT
Code Example
Html :: how to code hello world in html 
Html :: html umlaute 
Html :: css loading spinner img 
Html :: material ui appbar elevation 
Html :: how to change text color using only html 
Html :: html change background color of page 
Html :: capture webcam js 
Html :: html shortcuts 
Html :: html redirect after alert 
Html :: adding space tab in html 
Html :: ionic skeleton 
Html :: table column width 
Html :: bootstrap class width auto 
Html :: how to draw a small line in html 
Html :: html basic template 
Html :: html video player 
Html :: buttons in bootstrap 
Html :: tailwind custom column width 
Html :: hide navbar bootstrap 5 
Html :: svg marker 
Html :: how to add an svg image to html 
Html :: html clickable image 
Html :: html multiple file upload 
Html :: how to change the color of text in marquee in html 
Html :: what should i use for html 
Html :: input type password show asterisk 
Html :: html form element disabled readonly 
Html :: opening tag closing tag 
Html :: creating a table in html 
Html :: html select country list 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =