Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
Blank alert box when try to show text from an AJAX response

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);
        })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!