title: How to stop javascript alert from showing after pressing ok
body: <p>I want to show an alert if I have something in my Facebook inbox. I think it can be easily accomplished using userscripts... this is what I have so far (thanks to the guys at the <a href="http://userscripts.org/forums" rel="nofollow noreferrer">userscripts</a> forums):</p>
  
  <pre><code>document.addEventListener("DOMNodeInserted", function() {
    var count;
    if ((count=parseInt(document.getElementById("fb_menu_inbox_unread_count").textContent)) &gt; 0)
    alert("You have "+count+" new message"+(count==1 ? "" : "s")+".");
  }, true);
  </code></pre>
  
  <p>This works great, except the message gets stuck in a loop after clicking "OK", and keeps popping up. Is there a way to stop the message after I click dismiss the alert?</p>