“Toast JS” Kode Jawaban

Toastify JS

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
Crowded Cheetah

Toast JS

var toastTrigger = document.getElementById('liveToastBtn')
var toastLiveExample = document.getElementById('liveToast')
if (toastTrigger) {
  toastTrigger.addEventListener('click', function () {
    var toast = new bootstrap.Toast(toastLiveExample)

    toast.show()
  })
}
Arrogant Alligator

Toast JS

new Toast({
  message: 'This is an example with custom buttons',
  type: 'success',
  customButtons: [
    {
      text: 'Refresh the page',
      onClick: function() {
        window.location.reload();
      }
    },
    {
      text: 'Follow @ireaderinokun',
      onClick: function() {
        window.open('https://twitter.com/ireaderinokun');
      }
    }
  ]
});
Mateusz Przybylski

Jawaban yang mirip dengan “Toast JS”

Pertanyaan yang mirip dengan “Toast JS”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya