I have problem with alert in jquery. I want to print a information after the AJAX operation working, but i have an issue about using alert. When i using the alert syntax, it returns blank alert box, but when i checked it using console.log, the string is shown.
Here is my code that i used to print the result:
$.ajax({
data:...
method:'POST',
dataType:"json",
url: ...,
contentType:"application/json",
error:function(error){
var resp = JSON.parse(error["responseJSON"]);
var st = JSON.stringify(resp["status"]);
var dtl = JSON.stringify(resp["details"]);
var warning = "Status :"+st+"\\n details :"+dtl;
alert(warning);
},
success:function(response){
var resp = JSON.parse(response["responseJSON"]);
var st = JSON.stringify(resp["status"])
var dtl = JSON.stringify(resp["details"])
var warning = 'Status :'+st+'\\n details:'+dtl;
alert(warning);
})