title: Uncaught TypeError: b.replace is not a function
body: <p>Hi I am getting an uncaught type error in ajax file in console, even though everything is working properly...</p>
  
  <p>the html is </p>
  
  <pre><code>&lt;div id="deletepropertybutton"&gt;&lt;a href = "editproperty.php?property_id=&lt;?php echo $data['property_id'];?&gt;" class="editpropertybutton"&gt;Edit&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>the php is </p>
  
  <pre><code>$del_id = ($_POST['del_id']);
  
  $delete = $con-&gt;prepare("DELETE FROM tbl_property WHERE property_id='$del_id'");
  $delete-&gt;execute();
  
  $delete2 = $con-&gt;prepare("DELETE FROM tbl_favorite_properties WHERE favorite_properties_property_id='$del_id'");
  $delete2-&gt;execute();
  </code></pre>
  
  <p>and ajax is </p>
  
  <pre><code>$(document).ready(function()
  {
      $('.deletepropertybutton').click(function()
      {
          event.preventDefault();
          var del_id = $(this).attr('id');
          var $ele = $(this).parent().parent();
          $.ajax(
          {
              type: 'POST',
              url: '../controllers/deleteproperty.php',
              data:
              {
                  del_id: del_id
              },
              success: function(data)
              {
                  $.ajax(
                  {
                      type: 'POST',
                      url: "../controllers/managepropertiesajax.php",
                      success: function(data3)
                      {
                          $('#propertycounter').html("(" + data3 + ")");
                      }
                  });
                  $ele.fadeOut(1000).delay(1000).remove(1000);
              }
          });
      });
  });
  </code></pre>
  
  <p>how should i go about fixing this kind of error.. i am having this in other ajax files also the full error code is</p>
  
  <p>Uncaught TypeError: b.replace is not a function</p>
  
  <pre><code>at Function.ga.matchesSelector (jquery.js:2)
  at Function.r.filter (jquery.js:2)
  at Ia (jquery.js:3)
  at r.fn.init.remove (jquery.js:3)
  at Object.success (deletepropertyajax.js:27)
  at i (jquery.js:2)
  at Object.fireWith [as resolveWith] (jquery.js:2)
  at A (jquery.js:4)
  at XMLHttpRequest.&lt;anonymous&gt; (jquery.js:4)
  </code></pre>