你好我得到在控制檯AJAX文件未捕獲的類型錯誤,即使一切正常......遺漏的類型錯誤:b.replace不是一個函數
的HTML是
<div id="deletepropertybutton"><a href = "editproperty.php?property_id=<?php echo $data['property_id'];?>" class="editpropertybutton">Edit</a></div>
的PHP是
$del_id = ($_POST['del_id']);
$delete = $con->prepare("DELETE FROM tbl_property WHERE property_id='$del_id'");
$delete->execute();
$delete2 = $con->prepare("DELETE FROM tbl_favorite_properties WHERE favorite_properties_property_id='$del_id'");
$delete2->execute();
和AJAX是
$(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);
}
});
});
});
我應該如何去修復這種錯誤..我有這個在其他Ajax文件也完整的錯誤代碼是
遺漏的類型錯誤:b.replace不是一個函數
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.<anonymous> (jquery.js:4)
哪裏變'B'? '.replace()'在哪裏發生? –
沒有變量b,它進入jquery文件...我已經從jquery站點下載了 – DragonFire
你得到了什麼確切的錯誤? –