title: Use $.each and if with $.getJSON
body: <p>Me and $.each aren't good friends, I can't seem to figure out how I should use this statement to print all my data in my JSON file. Another problem is the if statement, I tried it in many ways, but whatever I do, no data is being printed.</p>
  
  <p>My JSON file</p>
  
  <pre><code>[
  {
  "expo":"pit",
  "datum":"05.06.2011 - 05.06.2016",
  "img":"images/pit_home.jpg",
  "link":"exp1_index.html"
  },
  {
  "expo":"Space Odessy 2.0",
  "datum":"17.02 - 19.05.2013",
  "img":"images/so_home.jpg",
  "link":"exp2_index.html"
  }
  ]
  </code></pre>
  
  <p>My $.getJSON script</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function read_json() {
          $.getJSON("home.json", function(data) {
              var el = document.getElementById("kome");
              el.innerHTML = "&lt;td&gt;&lt;a href=" + data.link + " data-ajax='false'&gt;&lt;img src=" + data.img + "&gt;&lt;div class='dsc'&gt;" + data.expo + "&lt;br&gt;&lt;em&gt;" + data.datum + "&lt;/em&gt;&lt;/div&gt;&lt;/a&gt;&lt;/td&gt;";
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>So how would I integrate the $.each statement and seperate from that, the if statement?</p>