I’ve been having trouble getting my quotes API to work. Originally, I used the $.getJSON() method, but it didn’t work and I Googled and found code using the .ajax() method with dataType as “jsonp”. Does anyone have a simple explanation for the difference between the two methods?
$(document).ready(function(){ $.ajax( {type: "GET", url: "https://talaikis.com/api/quotes/random/", dataType: 'jsonp', success: function (data){ $("#quote").html(data.quote); }, error: function(){ console.log("error"); } }); });
Using this code, I get the error: " talaikis.com/api/quotes/random/?callback=jQuery32104289845526983025_1495860515078&_=1495860515079:1 Uncaught SyntaxError: Unexpected token :" in the console. Is it saying the API has a syntax error, how do I fix this?