你好,我正在尝试使用Ajax打开一个表单。在按钮上单击表单请求“http://localhost/Forms/dl_contact_dealer.html",会收到整个文档,而且在DOM中添加它也有困难。
function openContactDealer(){
window.$$ = {};
// create & setup & send xhr
$$.xhr = getXHR();
var url = "http://localhost/Forms/dl_contact_dealer.html"
ajax({
url: url,
ctype: "text/html",
success: function(){
if(this.readyState == 4 && this.status == 200){
console.log(this);
var data = this.response;
}
}
});
}
你有什么建议吗?我试过使用createElement,createTextNode,还有使用过appendChild,不过都没用。