Javascript join elements, having problems
<p>I wasted 4 hours searching and trying, but no luck.</p>

<pre><code>if ((navigator.plugins) &amp;&amp; (navigator.plugins.length)) {
    for (var xx = 0, l = navigator.plugins.length; xx &lt; l; xx++) {    
        var tn = navigator.plugins[xx].name;    
        if (tn.indexOf("Java") != -1) {
            document.write("Found ");
        } 
        else {
            document.write("Nothing ");
        }    
    }
}
</code></pre>

<p>Insteading of writing just "Found" or "Nothing" this script writes the following: </p>

<pre><code>NothingNothingFoundNothing
</code></pre>

<p>(there are 4 plugins btw):</p>

<p>How do I fix this so that I only receive one answer? I don't want other way to find if Java is installed, just the above but working.</p>

<p><strong>Edit:</strong>
Thanks both of you, now it's working.</p>
