JavaScript How do I specify JSONP as the dataType in an angular $http service request? json specify data type

I'm familiar with using jQuery's $.ajax:

$.ajax({
  url: //twitter endpoint,
  method:"GET",
  dataType:"jsonp",
  success:function() {
    //stuff
  }
});

How can I specify the JSONP datatype to an angular $http service request?

so far I've tried this:

$http.get({
  url: //twitter endpoint,
  dataType: "jsonp",
  success: function(){
    //stuff
  }
});

It hasnt worked though. Any ideas?

Answer:1

You can always use $http.jsonp(url).success(function() {} );

$http.jsonp

Answer:2

I have a small JavaScript graphing/histogramming library which allows zooming/panning in either X or Y directions, or both, as declared when the plot is created. A simplified example is in this ...

I have a small JavaScript graphing/histogramming library which allows zooming/panning in either X or Y directions, or both, as declared when the plot is created. A simplified example is in this ...

I want to add a transition time to my pure javascript toggle class function I knew how to code it but i forgot and now need some advice <!DOCTYPE html> <html> <head> <style ...

I want to add a transition time to my pure javascript toggle class function I knew how to code it but i forgot and now need some advice <!DOCTYPE html> <html> <head> <style ...

I'm trying to make a countdown that is counting down in milliseconds; however, the countdown actually takes much longer than 7 seconds. Any idea as to why? function countDown(time){ var i = 0; ...

I'm trying to make a countdown that is counting down in milliseconds; however, the countdown actually takes much longer than 7 seconds. Any idea as to why? function countDown(time){ var i = 0; ...

<div class="foo"> <input name="moobar" /> <input name="foobar" /> </div> How do I replace all "oo" in the names found in $('.foo');? e.g. div.replace('oo', 'aa') => moobar ...

<div class="foo"> <input name="moobar" /> <input name="foobar" /> </div> How do I replace all "oo" in the names found in $('.foo');? e.g. div.replace('oo', 'aa') => moobar ...

  1. find replace name manager excel
  2. find replace name
  3. search and replace name
  4. find and replace name of files
  5. find replace file name windows
  6. find and replace name of files linux
  7. find and replace sheet name in excel formula
  8. maya find and replace name
  9. find and replace class name in jquery
  10. find and replace sheet name in excel
  11. bash find replace file name
  12. find and replace folder name
  13. autocad find replace layer name
  14. find and replace file name in unix
  15. find and replace file name mac
  16. find and replace in name manager
  17. intellij find replace file name
  18. find and replace file name in folder
  19. applescript find replace file name
  20. excel find replace file name