a href onclick javascript function
<p>I am printing the contents of the pop up on the link click:</p>

<p>In the beginning I had :</p>

<pre><code>&lt;a href="javascript:printDiv('popup-other-directions');" class="button"&gt;&lt;span&gt;Print Directions&lt;/span&gt;&lt;/a&gt;

function printDiv(divName) {
        var printContents = document.getElementById(divName).innerHTML;
        var originalContents = document.body.innerHTML;

        document.body.innerHTML = printContents;

        window.print();

        document.body.innerHTML = originalContents;
    }
</code></pre>

<p>But I understood that the above wasn't a good practice (calling a javascript function in href) and closes some old browser when link is clicked. </p>

<p>I changed it to :</p>

<pre><code>&lt;a href="#" onclick="javascript:printDiv('popup-other-directions');" class="button"&gt;&lt;span&gt;Print Directions&lt;/span&gt;&lt;/a&gt;
</code></pre>

<p>But I don't know why it still closes some of the old browsers (IE8 - windows XP) (works gud in windows7, Windows server2008)? </p>
