title: Execute javascript from bundles in Document.ready
body: <p>I use the MVC4 default template.</p>
  
  <p>I add a script : <code>MyScript.js</code> in <code>/Scripts/MyApp/</code>  with a function :</p>
  
  <pre><code>function Testing()
  {
      alert('test');
  }
  </code></pre>
  
  <p>In the global.asax : </p>
  
  <pre><code> bundles.Add(new ScriptBundle("~/bundles/myapp").Include(
      "~/Scripts/MyApp/MyScript.js"));
  </code></pre>
  
  <p>I'd like call this method in <code>/Views/Home/Index.cshml</code> </p>
  
  <p>I tried the code below but without success:</p>
  
  <pre><code>&lt;script type="text/javascript" lang="javascript"&gt;
      $(document).ready(function () {
          Testing();
      });
  &lt;/script&gt;    
  
  @Scripts.Render("~/bundles/myapp")
  </code></pre>
  
  <p>When I look the source code the link to <code>MyScript.js</code> is there and I can navigate to it (go to the source)</p>
  
  <p>But the <code>Testing()</code> method in the  <code>$(document).ready</code> is not executed.</p>
  
  <p><strong>Update1</strong></p>
  
  <pre><code>&lt;script type="text/javascript" lang="javascript"&gt;
  
      $(document).ready(function () {
          alert("test");
      });
  &lt;/script&gt;
  </code></pre>