我通过 new XMLHttpRequest() 进行 ajax 调用;
当我这样做时
var params = "x="+encodeURIComponent(x);
var xhr = new XMLHttpRequest();
xhr.open("POST", "....php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function(e) {
if (xhr.readyState == 4) {
$("#divID").html(e.currentTarget.responseText);
}
}
xhr.send(params);
它很好并且运行良好.....但是当结果包含@时我在控制台日志中收到此错误
Uncaught TypeError: Cannot read property 'removeChild' of null without using removeChild
澄清:例如:
当 php 给出<img src="..." />-->> 没关系
当 php 给出some text blablabla ...blalbla contact allo@test.com-->> 我得到错误
为什么我需要修复它???
慕姐8265434
明月笑刀无情
相关分类