title: Ajax Cross Domain Call not going to success function
body: <p>Hi I have developed a Web application Using Spring mvc. In that I have a method which returns the JSON data. When I call that method it will return the JSON data. </p>
  
  <p>But When i call the same method from a separate HTML page using AJAX it is not going to success function. </p>
  
  <p>Spring Method </p>
  
  <pre><code>@RequestMapping(value="/ManageDepartmentsMOb",method=RequestMethod.GET)
  public @ResponseBody List&lt;?&gt; manageDepartmentsMob(ModelMap model,HttpServletRequest request,HttpServletResponse response) throws JsonGenerationException, JsonMappingException, IOException
   {
     List&lt;DepartmentManagement&gt; deptList = departmentManagementService.findAll();  
     return deptList;
   }
  </code></pre>
  
  <p>My External HTML Page's ajax call</p>
  
  <pre><code>$.ajax({
        type : "GET"
        url : "http://localhost:8080/sta/ManageDepartmentsMOb",
        dataType : "JSONP",
        success : function(data)
        {
                alert("Success");
        }
  
  });
  </code></pre>
  
  <p>As I directly call my spring method it returns the JSON data as you can see in screen shot.</p>
  
  <p><img src="https://i.stack.imgur.com/NiYCg.png" alt="enter image description here"></p>