Passing parameters from my view (page) to my js file
<p>One question I ask myself for a long time: below are 2 methods for passing parameters from my view to my javascript:</p>

<p><strong>Method 1:</strong></p>

<p>My view:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    tabChangeConfirmationTitle = "@Html.Raw(UserResource.Warning)";
    tabChangeConfirmationMessage = "@Html.Raw(UserResource.TabChangeConfirmationMsg)";
&lt;/script&gt;
</code></pre>

<p>My javascript file:</p>

<pre><code>var tabChangeConfirmationTitle;
var tabChangeConfirmationMessage;
</code></pre>

<p><strong>Method 2:</strong></p>

<p>My view:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    fctTranslationsForConfirmationDialog("@Html.Raw(UserResource.Warning)", "@Html.Raw(UserResource.TabChangeConfirmationMsg)");
&lt;/script&gt;
</code></pre>

<p>My javascript file:</p>

<pre><code>var tabChangeConfirmationTitle;
var tabChangeConfirmationMessage;

function fctTranslationsForConfirmationDialog(Title, Message) {
    tabChangeConfirmationTitle = Title;
    tabChangeConfirmationMessage = Message;
}
</code></pre>

<p>I prefer the 1st method. Is it a good one? Is there a better method?</p>

<p>Thanks.</p>

<p>PS: I know there are othere related questions but I would like your opinion on these two methods.</p>
