Using jQuery, how do I pass arg to function and then display a message from predefined variable
<p>I want to call this function, pass which type of error it is as an arg, and then display the message.</p>

<pre><code>function msgDialog(msg) {
    // Define messages
    var errorMsg = "There has been an error.  We are sorry about that.";
    var loginMsg = "Something went awry with the login.  Please try again.";
    var uploadMsg = "Your upload failed.  Please try again.";
    var networkMsg = "You currently are not connected to the internet.  Please connect and try again.";
     alert(msg);
}
</code></pre>

<p>How do I call that function msgDialog(loginMsg) and have a var which I can assign to the correct message, then do something with that?  Here I am alerting it, but I will really display it differently.  I know that I need to create a new var with the value of the arg value, but not sure how.  Thank you.</p>
