我不使用
removeChild()
,也不会在有东西之前尝试删除任何东西。jquery-3.3.1.min.js:2 Uncaught TypeError: Cannot read property 'removeChild' of null
at m (jquery-3.3.1.min.js:2)
at Function.globalEval (jquery-3.3.1.min.js:2)
at text script (jquery-3.3.1.min.js:2)
at Ut (jquery-3.3.1.min.js:2)
at k (jquery-3.3.1.min.js:2)
at XMLHttpRequest.<anonymous> (jquery-3.3.1.min.js:2)
at Object.send (jquery-3.3.1.min.js:2)
at Function.ajax (jquery-3.3.1.min.js:2)
at Function.w._evalUrl (jquery-3.3.1.min.js:2)
at Re (jquery-3.3.1.min.js:2)
我使用$.ajax
接收HTML内容,然后使用.html()
将其放入一个
容器中。
$(".kontakt").click(function(a) {
$('.opt-out').fadeOut();
a.stopPropagation()
a.preventDefault()
$.ajax({async: true,
type: "POST",
url: "classes/handle.ajax.class.php",
data: {
class: "kontakt"
},
success: function(a) {
$(".link-container").html(a)
$('.link-container').fadeIn();
blur();
}
})
})