Dynamically add browser name into page
<p>I have a small script that detects the userAgent and basically writes a small 'hello' message with the browser the user is using. I'm using it for a small demo i'll be showing to people, I know feature detection is better so don't worry. It's mainly to demo the script.</p>

<p>But basically, I was wondering if there is any better way to write this:</p>

<p><a href="http://jsfiddle.net/m5cVf/" rel="nofollow">http://jsfiddle.net/m5cVf/</a></p>

<p>I need to show a quick fun little message, but instead of doing loads of 'if' statements for each browser, I want to put them in array and add the browser name into the function if the current browser is true, rather than calling <code>doAlert();</code> multiple times.</p>

<p>Something like:</p>

<pre><code>var browsers = chrome,safari,mozilla;
</code></pre>

<p>then if the browser in use is 'true' this would get added into the function instead of manually adding them inside each 'if' statement. Thanks and much appreciated!</p>
