title: Using razor to set javascript variables inline, is it good practice/safe?
body: <p>If I wanted to set some javascript variables from my model would that be a safe practice?  For example:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var myVariable = '@Model.myVar';
  &lt;/script&gt;
  </code></pre>
  
  <p>Is this an ok practice?  I cant think of a better way to really do it, besides maybe doing hidden input, but that seems like too much work compared to this.  I just dont know if this is vulnerable or if there's something im overlooking by doing this.</p>