title: Call Jquery function inside razor's subviews
body: <p>I want to use such an activity <code>$('#myModal').show();</code> </p>
  
  <p>The original calling plugin routine is as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
       $('#myButton').click(function(e) {
            e.preventDefault();
        $('#myModal').show();
       });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I put my code in the below section.
  Here <code>$('#myModal').show({});</code> doesn't run</p>
  
  <pre><code>    @using (Html.BeginForm("Contact", "Home", FormMethod.Post, new { name = "send-contact", id = "contactform1" }))
      {       
              @Html.AntiForgeryToken()  
  
              if (!String.IsNullOrEmpty(stResult)) 
               {                
                   &lt;text&gt;
                          &lt;div id="myModal" class="reveal-modal"&gt;
                               &lt;h1&gt;Modal Title&lt;/h1&gt;
                               &lt;p&gt;Any content could go in here.&lt;/p&gt;
                               &lt;a class="close-reveal-modal"&gt;&amp;#215;&lt;/a&gt;
                          &lt;/div&gt;
  
                       $('#myModal').show({}); // The desired function!
                   &lt;/text&gt;
  
               }
       }
  </code></pre>
  
  <p>There are 2 problems on this approach within my code</p>
  
  <ol>
  <li><p>The <strong>JQuery library</strong> is located at the bottom line of the Master Page (_Layout)
  There's a <strong>wrapper</strong> over all the plugins inside the famous <code>ready()</code> function which is located there.</p></li>
  <li><p>As an alternative way I placed the <code>$('#myModal').show();</code> inside the <code>JQuery.ready()</code> in the Wrapper which when it calls everything if it should have found the <code>"#myModal"</code> based on my conditions then it'll fire the function I desired.
  but again that won't fire.</p></li>
  </ol>
  
  <p>I think this approach seems to be more logical and may be the only logical between these 2 approaches cause the first one the function isn't located in the <strong>JQuery ready</strong> function, and if I use another ready function here it's also wrong because of the duplicate of ready function.</p>