title: jQuery datepicker not working after ajax update on MVC partial view in Firefox and IE
body: <p>I have an MVC view that has a div container which I update via ajax.</p>
  
  <pre><code>&lt;div id="PartialContainer"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  $.ajax({
          url: '/my/partial_action',
          success: function(result) {
              $("#PartialContainer").html(result);
          }
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The controller action code:</p>
  
  <pre><code>public ActionResult partial_action()
  {
      return PartialView("_MyPartial");
  }
  </code></pre>
  
  <p>And finally, _MyPartial view:</p>
  
  <pre><code>&lt;input type="text" class="datepicker" /&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function() {
          alert("before");
          $("input.datepicker").datepicker();
          alert("after");
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The problem:
  This works fine in Chrome, I get the datepicker dropdown fine, both alerts (before and after) show. In FF and IE however, the datepicker isn't working. I do get both alerts, but not the datepicker behavior. There are no firebug/F12 script errors.</p>
  
  <p>I tried adding a datepicker input outside the partial view, and it worked fine in all browsers.</p>
  
  <p>I'm using jQuery ui 1.7.2, mvc 4.</p>
  
  <p>Anyone has any ideas why this is happening?</p>
  
  <p><strong>EDIT:</strong> So I solved the problem, it wasn't a javascript issue, but styling issue. I use the datepickers in a twitter bootstrap dialog, and it was covering the datepicker. Changing some z-indexed fixed it for me.</p>