title: Reload jQuery functions after Ajax call
body: <p>I don't know a lot about jQuery, and I want know how do I reload all the functions of jQuery after a ajax call, because I add element in a  and then the new element don't work but the others work fine.</p>
  
  <p>The ajax call:</p>
  
  <pre><code>$(document).ready(function () {
  
      $('#search-bar').keyup(function (event) {
          if (event.keyCode == 13) {
              myFunction();
  
          }
      });
  
          var city = $('#search-bar').val();
          $.ajax({
              url: '@Url.Action("getWeatherSearch", "Index")',
              data: { city: city },
              //async: false,
              error: function (resp) {
                  var div = document.getElementById('rb-grid');
                  div.innerHTML = resp.responseText + div.innerHTML;
              },
              success: function (resp) {
                  $("#rb-grid").prepend(resp);
              }
          });
  </code></pre>
  
  <p>HTML:</p>
  
  <p>The textbox:
                  
                      @Html.TextBox("search-bar", "", new { @class = "search-bar", placeholder = "Pesquisar" })
                  </p>
  
  <p>This is where I wnat to add the new <LI> that I create dinamically, calling the method from c# using the ajax: </p>
  
  <pre><code>        &lt;ul id="rb-grid" class="rb-grid clearfix"&gt;
  
              &lt;li class="icon-clima-1 rb-span-2"&gt;
                  &lt;h3&gt;@ViewBag.CurrentCity&lt;/h3&gt;&lt;span class="rb-temp"&gt;@ViewBag.CurrentTemp°C&lt;/span&gt;
                  &lt;div class="rb-overlay"&gt;
                      &lt;span class="rb-close"&gt;close&lt;/span&gt;
                      &lt;div class="rb-week"&gt;
                          &lt;div&gt;&lt;span class="rb-city"&gt;@ViewBag.CurrentCity&lt;/span&gt;&lt;span class="icon-clima-1"&gt;&lt;/span&gt;&lt;span style="font-size: 60px !important;"&gt;@ViewBag.CurrentTemp ºC&lt;/span&gt;&lt;span style="font-size: 40px !important;"&gt;Min: @Next0.tempMinC ºC&lt;/span&gt;&lt;/div&gt;
                          &lt;div style="width: 17.5%;"&gt;&lt;span&gt;@Next1.date.DayOfWeek.ToString().Substring(0, 3)&lt;/span&gt;&lt;span class="icon-clima-1"&gt;&lt;/span&gt;&lt;span style="font-size: 40px !important;"&gt;Max: @Next1.tempMaxC ºC &lt;br /&gt;&lt;br /&gt; Min: @Next1.tempMinC ºC&lt;/span&gt;&lt;/div&gt;
                          &lt;div style="width: 17.5%;"&gt;&lt;span&gt;@Next2.date.DayOfWeek.ToString().Substring(0, 3)&lt;/span&gt;&lt;span class="icon-clima-1"&gt;&lt;/span&gt;&lt;span style="font-size: 40px !important;"&gt;Max: @Next2.tempMaxC ºC &lt;br /&gt;&lt;br /&gt; Min: @Next2.tempMinC ºC&lt;/span&gt;&lt;/div&gt;
                          &lt;div style="width: 17.5%;"&gt;&lt;span&gt;@Next3.date.DayOfWeek.ToString().Substring(0, 3)&lt;/span&gt;&lt;span class="icon-clima-1"&gt;&lt;/span&gt;&lt;span style="font-size: 40px !important;"&gt;Max: @Next3.tempMaxC ºC &lt;br /&gt;&lt;br /&gt; Min: @Next3.tempMinC ºC&lt;/span&gt;&lt;/div&gt;
                          &lt;div style="width: 17.5%;"&gt;&lt;span&gt;@Next4.date.DayOfWeek.ToString().Substring(0, 3)&lt;/span&gt;&lt;span class="icon-clima-1"&gt;&lt;/span&gt;&lt;span style="font-size: 40px !important;"&gt;Max: @Next4.tempMaxC ºC &lt;br /&gt;&lt;br /&gt; Min: @Next4.tempMinC ºC&lt;/span&gt;&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
  </code></pre>
  
  <p>this is how I activate Boxgrid:</p>
  
  <pre><code>&lt;script&gt;
      $(function () {
          Boxgrid.init();
      });
  &lt;/script&gt;
  </code></pre>