Getting return validation from server

Getting return validation from server

In my website I have a custom form for an event requisition

It works but fails to get the "RES.txt" data that says "{"SUCCESS":"Request submitted successfully"}"

What am I doing wrong? I am using a combination of JavaScript and AJAX, I have simplified my code here to the issue I am having.

If I directly call the HTML snippet code that makes the appointment I get a download bar for "RES.txt" which is the response from the server. But I fail to parse it in my code :(. I feel stupid fighting this for so long.

<!DOCTYPE html>
<html>
<body>

<div id="demo"><h2>Let AJAX change this text</h2></div>

<button type="button" onclick="loadDoc()">Change Content</button>

<script>
function loadDoc() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (xhttp.readyState == 4 ) {
      document.getElementById("demo").innerHTML = xhttp.responseText;     
    }
  };
  xhttp.open("GET", "https://calendar.zoho.com/eventreq/654a5ab7a88f2fcefd8c90b93aacd51e698b57d7e7166773b8f1b9505b0080a34a64100d17cdc3bb?name=test name&mailId=kage.sabaku.no.gaara@gmail.com&date=12/02/2015&time=13:00&reason=test 2 Reason for Appointment", true);
  xhttp.send();

}

</script>

</body>
</html>


      • Sticky Posts

      • The year that was at Zoho Calendar 2023- Part 1

        Hello, amazing community members! Happy new year from all of us here at Zoho Calendar. As we begin the new year, we'd like to thank each and everyone of our community members for your unwavering support and love that you have shown for Zoho Calendar.
      • What's new in Zoho Calendar!

        Hello all, Greeting from Zoho Calendar! Hope you are all doing well! We at Zoho Calendar are constantly striving to improve our Calendar to enhance your overall calendaring experience thanks to your insightful suggestions and feedback. In the last few
      • Enhancements to make Zoho Calendar more accessible and handy!

        Hello, Community! Hope you're all doing well! Zoho Calendar have come across a major revamp a year back. Since then the feedback and suggestions given by you made us to improve and enhance Calendar, to make it more accessible and user friendly. We've
      • Important announcement: Deprecation of Zoho Calendar's old interface

        Hello All! Thank you all for the amazing welcome to the release of the new Calendar. Here are some comments about the new interface that motivated us:  Many of our users who were using the older version for a long period, loved the new Calendar, as it
      • What's new in the revamped calendar - An overview of user interface and features

        Hello Everyone, Scheduling meetings and events using online calendars has become inevitable as almost the entire business world has gone online. Keeping track of events, meetings and appointments has become a necessity. To serve you better, we at Zoho have