javascript - changing title appends rather than rewrites
<p>I have created a news feed script which automatically informs the user when new news items are available, like on twitter. I want to add this alert to the title so used this;</p>

<pre><code>var originalTitle = document.title;
document.title = '(' + result + ') ' + originalTitle;
</code></pre>

<p>Now I don't see the problem but it appends the <code>result</code> value before the <code>originalTitle</code> which would be fine if it wasn't costantly being updated whenever there's new news.</p>

<p>E.g; If 1 story is added and not another for a long time you get this;</p>

<pre><code>(1) (1) (1) (1) (1) (1) title 
</code></pre>

<p>E.g 2; If stories keep on getting added you get this;</p>

<pre><code>(5) (4) (3) (2) (1) title
</code></pre>

<p>Not pretty. I want the while title to be rewritten each time and not just have the <code>result</code> appended infront each time.</p>
