title: Javascript only works in Chrome
body: <p>My Javascript pulls from an API array a list of results. For some reason it works perfectly in Chrome but no other browser. Can anyone tell me where I'm going wrong? Full webpage is <a href="http://that-gift.co.uk" rel="nofollow">http://that-gift.co.uk</a>, code below.</p>
  
  <pre><code>var dataCallback = function(data) {
  
  
    for (var i = 0; i &lt; data.length; i++) {
      var d = data[i];
      for (var k in d.data) {
          if (k == 'price'){
            price = d.data[k];
  
          }
          if (k == 'name'){
            name = d.data[k];
      if(name.length &gt; 10) name = name.substring(0,30) + "...";
  
          }
          if (k == 'link'){
            link = d.data[k];
  
          }
          if (k == 'image'){
            image = d.data[k];
  
          }
      }
          document.write("&lt;div class='result'&gt;&lt;a href='" + link + "' target='_blank'&gt;&lt;img src='" + image + "'&gt;&lt;div class='resultname'&gt;" + name + "&lt;/div&gt;&lt;span class='prices'&gt;&amp;#163;"+ price + "&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;");
        }
  }
  </code></pre>