title: Using Jquery chosen in jquery ajax
body: <p>I am using jquery chosen and calling ajax on change drop down but records are not displaying. This code which I am using after changing drop down.</p>
  
  <pre><code>    $.ajax({
          type: "POST",
          url: "MY URL",
          data: {
              sno: $(this).val()
          },
  
          success: function (resp) {
              var resp = jQuery.parseJSON(resp);
              if (resp.length == 0) {
                  $("#site").html('&lt;option value="0" selected&gt;Select Site&lt;/option&gt;');
  
              } else {
                  $.each(resp, function (i, item) {
                      $('#site').append($('&lt;option&gt;', {
                          value: item.siteNameID + '-' + item.siteName,
                          text: item.siteName
                      }));
                  });
              }
          },
          error: function (resp) {
  
              console.log('error');
          }
      });
  </code></pre>
  
  <p>One thing I have noticed jquery chosen applying on my select box but data which I am fetching from server side is not adding in that select box</p>