title: How to put a result from json file in variable javascript
body: <p>I'm setting up a new server using a PLC. With this this server I must turn on/off the lights. At the moment I use a function to refresh the values coming from the PLC so the main page doesn't have to refresh constantly. I can already show a 1 or a 0 using an id and a label. I want to show a picture instead of a 1 or a 0.</p>
  
  <p>I tried first with a 1 or a 0 instead of an image to simplify and see if that works. I thought by using L_Software and check if the value is 1 or 0 to return a 1 or 0.</p>
  
  <pre><code>      &lt;label id="test"&gt; dummy &lt;/label&gt;
        &lt;br&gt;
        &lt;label id="L_Refter"&gt;:="DB1 Lichten".Refter:&lt;/label&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/body&gt;
    &lt;script type="text/javascript"&gt;
            $(document).ready(function(){
                $.ajaxSetup({ cache: false });
            setInterval(function() {
                $.getJSON("DataLichten.html", function(result){
                  $('#L_Software').text(result.Software)
                  $('#L_Refter').text(result.Refter)
                });
            },1000);
            });
            function lamp(waarde)
            {
              if (waarde=="1")
              {
                return 1;
              }
              if (waarde=="0")
               {
                return 0;
              }
            }
            document.getElementById("test").innerHTML = lamp(L_Software);
    &lt;/script&gt;
  </code></pre>
  
  <p>I expect to show a 1 or a 0 instead of dummy. And later on make the 1 or 0 an image.</p>