JavaScript syntax error in IE when using Var
<p>I have a bookmarklet code in javascript that works perfectly fine in chrome but does not even show the bookmarklet content in IE. I have looked up the script window in IE and it give me the following error:</p>

<pre><code>SCRIPT1002: Syntax error 
main.jsp, line 93 character 1
</code></pre>

<p>main.jsp line 93:</p>

<pre><code>&lt;a  href="
        javascript:
        var md=0;
        var maxImage;
        var imgElements = document.body.getElementsByTagName('img');
        for (var index in imgElements) {
            var img = imgElements[index];
            var cd = img.width * img.height;
            if (cd  &gt; md){
                md = cd;
                maxImage = img;
            }
        }
</code></pre>

<p>The problem, seems like, is coming from the line:</p>

<pre><code>var maxImage;
</code></pre>

<p>does anyone know how to fix this?</p>

<p>Thanks</p>
