title: Passing a razor object to a javascript function
body: <p>I have my JS function:</p>
  
  <pre><code>function LoadJs(hostApp) {
      $.ajax({
          type: "POST",
          url: '@Url.Action("LoadJs", "Home")',
          data: { "hostApp": hostApp },
          success: function (Js) {
              Response.Write(Js)   
          }
      });
  }
  </code></pre>
  
  <p>When I call the function in my <code>Summary.vbhtml</code> file, I would like to pass it my hostApp object and then have the Javascript pass the object to a controller action. </p>
  
  <p>Here is my <code>script</code> tag calling the <code>LoadJs</code> function:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;    
      LoadJs( @(model)); 
  &lt;/script&gt;
  </code></pre>
  
  <p>I've tried <code>'@model'</code>, <code>'@(model)'</code>, and <code>@model</code>but nothing seems to pass it correctly. When I pass it the first two ways, it passes a string, which is not what I want and if I try the last way or the way in the example then it turned <code>@model</code> into the correct object, but it says it is undefined.</p>