Append values in dropbox list with apostrophes

Append values in dropbox list with apostrophes

Hi guys, I am populating a dropdown box with values received from a query (using ajax json mysqli). All works fine until data is found with an apostrophe in it. Then the dropbox is completely empty, although some data have no apostrophes. Can someone help me out here? I suppose the code in red needs to be altered so that data with apostrophes will show in the dropdown box. Many thanks in advance! Here is my code:

  1. function getThuisploeg()
  2. {
  3.     seizoen = $("#Seizoen-text").val();
  4.     competitie = $("#Competitie-list").val();
  5.     speelweek = $("#Speelweek-list").val();
  6.     $.ajax({
  7.         type:'POST',
  8.         url:'get_thuisploeg.inc.php',
  9.         dataType: 'json', 
  10.         data: {seizoen: seizoen, competitie: competitie, speelweek: speelweek},
  11.         success: function(response){
  12.             $("#HomeTeam-list").empty();
  13.             $("#HomeTeam-list").append("<option>HomeTeam</option>");
  14.             var len = response.length;
  15.             for(var i = 0; i < len; i++){
  16.                 var thuisploeg = response[i]['BLA'];
  17.                 $("#HomeTeam-list").append('<option value="'+thuisploeg+'">'+thuisploeg+"</option>");
  18.             }
  19.         }
  20.     });
  21. }