Problem setting window.onload and window.onresize
<pre><code>&lt;script type="text/javascript"&gt;
    window.onload = widthFunction();
    window.onresize = function widthFunction(){
        var viewportWidth;
        var fouronefour;
        rotdiv = document.getElementById("rotationdiv");
        viewportWidth = window.innerWidth;
        fouronefour = 414;
        if(parseInt(viewportWidth) &lt; parseInt(fouronefour))
        {rotdiv.style = "visibility:visible;";}
        }
&lt;/script&gt;

&lt;body&gt;
&lt;div id="rotationdiv" style="visibility:collapse;"&gt;If you would like to see more columns, click &lt;a href="WiderPage.aspx"&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>I know there is a problem with <code>window.onload = widthFunction();</code>. What I basically want this function to do is "on load and on resize, check the screen size. if the screen size is more than 414px, display the div asking the client to go to a wider page."</p>

<p>It's a gridview with many boundfields. I figured I'd try this because I'm scaling my website down to a mobile browser</p>
