jquery-3.1.0.min.js:2 jQuery.Deferred exception: Cannot read property 'addEventListener' of null TypeError: Cannot read property 'addEventListener' of null
at HTMLDocument.<anonymous> (http://1-4at/res/scripts/chat2.js:240:15)
at j (http://1-4at/res/lib/jquery-3.1.0.min.js:2:29568)
at k (http://1-4at/res/lib/jquery-3.1.0.min.js:2:29882) undefined
r.Deferred.exceptionHook @ jquery-3.1.0.min.js:2
k @ jquery-3.1.0.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.1.0.min.js:2
i @ jquery-3.1.0.min.js:2
fireWith @ jquery-3.1.0.min.js:2
fire @ jquery-3.1.0.min.js:2
i @ jquery-3.1.0.min.js:2
fireWith @ jquery-3.1.0.min.js:2
ready @ jquery-3.1.0.min.js:2
R @ jquery-3.1.0.min.js:2
jquery-3.1.0.min.js:2 Uncaught TypeError: Cannot read property 'addEventListener' of null
at HTMLDocument.<anonymous> (chat2.js:240)
at j (jquery-3.1.0.min.js:2)
at k (jquery-3.1.0.min.js:2)
(anonymous) @ chat2.js:240
j @ jquery-3.1.0.min.js:2
k @ jquery-3.1.0.min.js:2
setTimeout (async)
r.readyException @ jquery-3.1.0.min.js:2
(anonymous) @ jquery-3.1.0.min.js:2
j @ jquery-3.1.0.min.js:2
k @ jquery-3.1.0.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.1.0.min.js:2
i @ jquery-3.1.0.min.js:2
fireWith @ jquery-3.1.0.min.js:2
fire @ jquery-3.1.0.min.js:2
i @ jquery-3.1.0.min.js:2
fireWith @ jquery-3.1.0.min.js:2
k @ jquery-3.1.0.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.1.0.min.js:2
i @ jquery-3.1.0.min.js:2
fireWith @ jquery-3.1.0.min.js:2
fire @ jquery-3.1.0.min.js:2
i @ jquery-3.1.0.min.js:2
fireWith @ jquery-3.1.0.min.js:2
ready @ jquery-3.1.0.min.js:2
R @ jquery-3.1.0.min.js:2
var mesdelete = document.getElementById("1");
mesdelete.addEventListener("click", delete_message);
function delete_message(){
var messID = mesdelete.id;
$(document).ready(function(){
$.ajax({
url:"delete.php",
type:"POST",
data: ({deleteID: messID}),
dataType:"html",
success:deleteend
});
});
}
mesdelete.on("click", delete_message);
var mesdelete = document.getElementById("1");
mesdelete.addEventListener("click", delete_message);
function delete_message(){
var messID = mesdelete.id;
...
}
$(document).ready(function(){
...
});