Why quote API doesn't load

Hello Fellows

Could anybody tell me why my code doesn’t show anything in the console when trying to use this API

<button id="nextQuote">press</button>

JavaScript code


$(document).ready(function(){
$("#nextQuote").on("click",function getData(quote,author){
$.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function(json) {
  
   quote = json.quoteText; 
   author = json.quoteAuthor; 
  console.log(quote);

 
  });   
 });   
});

would appreciate your support

Hello there!

I just copied and pasted your code as-is into CodePen and it’s printing quotes in the console just fine. Have you double-checked that jQuery is actually available to the project that you are working on?

I hope that helps!

@honmanyau yes it is attached could you please share with me your codepen link

Have you attached jQuery like this: