alert
, confirm
and prompt
JS-005210322 ajax,
10323 response,
10324 ) {
10325 if (window.confirm(response.message)) {10326 window.location.reload(true);
10327 }
10328 };
6964 url: "./sitemap.xml",
6965 dataType: "xml",
6966 error: function (e) {
6967 alert("An error occurred while processing XML file"), 6968 console.log("XML reading Failed: ", e);
6969 },
6970 success: function (response) {
6958 -1 < navigator.userAgent.indexOf("Trident")) &&
6959 $("main").attr("role", "main"),
6960 $(".populatesitemap").click(function () {
6961 alert("working"), 6962 $.ajax({
6963 type: "GET",
6964 url: "./sitemap.xml",
7081 url: "./sitemap.xml",
7082 dataType: "xml",
7083 error: function (e) {
7084 alert("An error occurred while processing XML file"), 7085 console.log("XML reading Failed: ", e);
7086 },
7087 success: function (response) {
7075 -1 < navigator.userAgent.indexOf("Trident")) &&
7076 $("main").attr("role", "main"),
7077 $(".populatesitemap").click(function () {
7078 alert("working"), 7079 $.ajax({
7080 type: "GET",
7081 url: "./sitemap.xml",
JavaScript's alert
, confirm
and prompt
functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation.
Furthermore, alert
is often used while debugging code, which should be removed before deployment to production.
alert("here!");
confirm("Are you sure?");
prompt("What is your name?", "John Doe");
customAlert("Something happened!");
customConfirm("Are you sure?");
customPrompt("Who are you?");
function foo() {
const alert = myCustomLib.customAlert;
alert();
}