title: Get JSON object from AJAX call
body: <p>I'm new to <code>AJAX</code> and <code>javascript</code>. In my project, I have to get a <code>json</code> object in my <code>javascript</code> file. I've used <code>spray-json</code> and it shows me the json object in the url. <code>http://localhost:8081/all-modules</code></p>
  
  <pre><code>{
    "status": "S1000",
    "description": "Success",
    "results": ["module1", "module2", "module3"]
  }
  </code></pre>
  
  <p>My Ajax call </p>
  
  <pre><code>  $.ajax({
          url: 'http://localhost:8081/all-modules',
          dataType: 'application/json',
          complete: function(data){
              alert(data)
          },
          success: function(data){
              alert(data)
          }
  </code></pre>
  
  <p>It returns an alert <code>[object Object]</code>. What is the issue in here?</p>