weixin_33735676 2015-04-08 20:16 采纳率: 0%
浏览 54

使用Ajax打开表单出错?

你好,我正在尝试使用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,不过都没用。

  • 写回答

1条回答 默认 最新

  • weixin_33720186 2015-04-08 20:18
    关注

    select an element and use element.InnerHTML to insert the response.

    评论

报告相同问题?