title: Device pixel ratio undefined
body: <p>I am using javascript to see a cookie to the device pixel ratio. In IE device pixel ratio outputs undefined, so I want to use a conditional to say, if undefined set as 1. </p>
  
  <p>I have been trying a few different approaches, but thought this would work:</p>
  
  <pre><code>&lt;script&gt;
                      if (window.devicePixelRatio==undefined) {
                          document.cookie='screenpixelratio='1'; path=/';location.reload(true);
                      } else {
                          document.cookie='screenpixelratio='+window.devicePixelRatio+'; path=/';location.reload(true);
                      }
                  &lt;/script&gt;
  </code></pre>
  
  <p>But, I cant get it to output 1. </p>
  
  <p>Does anyone know how I can achieve this?</p>