Problem with getJSON

Hi I’m trying to get json from an external website and displaying it on mypage I’ve tried a lot of thing but none of them work, here’s my code:


<body class = "bodyBackColor">
  <div class = "container-fluid">
    <div class = "quotes1">
    <button id = "showQuote" class = "btn btn-primary">
      show Quote


$(document).ready(function() {
  $("#showQuote").on("click", function () {

    $.getJSON("", function(json) {


I’ve tried using($.getJSON(" and nothing, the click function is working, but after the getJSON it doesn’t do anything, I place an alert inside it but never shows, so please tell me what am I doing wrong.


Check out the jquery api for it ( The function uses what is called a promise which means you can chain on a done () and fail() method. What I would do is implement those and see if any errors are returned in the fail() part of the promise then go from there.