diff --git a/demo.html b/demo.html index c1ac6506..816f097f 100644 --- a/demo.html +++ b/demo.html @@ -201,7 +201,7 @@

Links

var getMessageWithClearButton = function (msg) { msg = msg ? msg : 'Clear itself?'; - msg += '

'; + msg += '

'; return msg; }; @@ -287,6 +287,11 @@

Links

var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists $toastlast = $toast; + + if(typeof $toast === 'undefined'){ + return; + } + if ($toast.find('#okBtn').length) { $toast.delegate('#okBtn', 'click', function () { alert('you clicked me. i was toast #' + toastIndex + '. goodbye!');