 <p>Well, for starters you'd have to avoid the client's navigation cache (often a back/forward doesn't actually pull the page back down).</p> <p>After that hurdle you can look at (ironically) using a session variable to store if it's been viewed [output] and only dump it to the page once.</p> <p>if that seems to much, you could just add a cookie check in the function so when it's run (and re-run) it checks for a cookie and, when absent, makes an alert and sets a cookie. Pseudocode:</p> <pre><code>function showAlert(msg){ if (cookie[msg] == null){ // a cookie doesn't exist for this msg alert(msg); // alert the msg cookie[msg] = true; // set the cookie so the next pass is ignored } } </code></pre>