title: How to call java script function from mvc view
body: <p>Let say I have the following javascript</p>
  
  <pre><code>function blob(alertText) {
       alert(alertText);
  }
  </code></pre>
  
  <p>I would like to call the function within my view. something like:</p>
  
  <pre><code>&lt;% if (x == 0)
      //Need to Call the javascript function here. e.g. blob("sometext");
  %&gt;
  </code></pre>
  
  <p>How can I call the the javascript function within the enclosed if statement in my view?</p>