任何人都可以告诉我为什么我收到此错误:
未捕获的TypeError:无法读取未定义的属性’replace’
function checkNewPost(x) {
var pid = $('#NewPostbody').attr('class');
if(pid === 'post-t') {
setTimeout(checkNewPost,PHP echo $p_id; ?>);
} else {
$.ajax({
type: "POST",url: "/html_postReply.PHP",data: "pid="+pid.replace('post-t','')+"&type=1",success: function(html) {
if(html) {
$('.tekin').append(html);
jQuery("span.timeago").timeago();
$(".tekin").scrollTop($(".tekin")[0].scrollHeight);
}
if(!x) {
setTimeout(checkNewPost,PHP echo $p_id; ?>);
}
}
});
}
}
checkNewPost();
最佳答案
原文链接:https://www.f2er.com/jquery/428357.html