built-in alert box
alert('An exception occurred.');
event.target.nextElementSibling.textContent = 'The application has just got an exception.';
Simple Popup alternative
simplePopup(0, 'An exception occurred.').then(function() {
event.target.nextElementSibling.textContent = 'The application has just got an exception.';
});
built-in confirm box
var res = confirm('It\'s time to change. Do you agree with me?');
if (res) {
event.target.nextElementSibling.textContent = 'Yes, let\'s go for it.';
} else {
event.target.nextElementSibling.textContent = 'No, this is not the time.';
}
Simple Popup alternative
simplePopup(1, 'It\'s time to change. Do you agree with me?').then(function(res) {
if (res) {
event.target.nextElementSibling.textContent = 'Yes, let\'s go for it.';
} else {
event.target.nextElementSibling.textContent = 'No, this is not the time.';
}
});
built-in prompt box
var username = prompt('Please enter your username', 'Michael Jordan');
if (username != null && username != '') {
event.target.nextElementSibling.textContent = username + ', hey, welcome back.';
}
Simple Popup alternative
simplePopup(2, 'Please enter your username', 'Michael Jordan').then(function(res) {
if (res) {
event.target.nextElementSibling.textContent = res + ', hey, welcome back.';
} else {
event.target.nextElementSibling.textContent = 'Anoymous user logs in.';
}
});