Using window.alert to give an alert