title: ionic Angularjs vs jquery : $http.jsonp() vs jquery.ajax
body: <p>I am trying to get some json data from an api it works with jquery but doesn't work with angularjs?</p>
  
  <p>I am using Ionic to code the app.</p>
  
  <p>I don't think it is a CORS issue, if it were the jQuery code wouldn't work. </p>
  
  <p>in jQuery i do the following: (Working)</p>
  
  <pre><code>$.ajax({
   url: "http://api.somesite.com/api?format=json",
    type: "GET", //it works with POST as well
    dataType: 'jsonp',
   })
    .done(function( data ) {
      if ( console &amp;&amp; console.log ) {
        console.log( "Sample of data:", data );
      }
    });
  </code></pre>
  
  <p><strong>console result:</strong>
  <a href="http://imgmonkey.com/hfrk2cbfz1gi/firstSuccess.png.html" rel="nofollow">http://imgmonkey.com/hfrk2cbfz1gi/firstSuccess.png.html</a></p>
  
  <p>This is the Angularjs Code: (Not Working)</p>
  
  <pre><code> url="http://api.somesite.com/api?format=json";
  
   $http.jsonp(url)
   .success(function(data, status, headers, config) {
     console.log(data);
      console.log(status);
       console.log(headers);
      console.log(config);
  })
  .error(function(data, status, headers, config) {
      console.log(data);
      console.log(status);
       console.log(headers);
      console.log(config);
  });
  </code></pre>
  
  <p><strong>console result:</strong>
  <a href="http://imgmonkey.com/v16ug212dm0d/second_fail.png.html" rel="nofollow">http://imgmonkey.com/v16ug212dm0d/second_fail.png.html</a></p>