weixin_33749242 2014-05-16 19:18 采纳率: 0%
浏览 17

为AJAX创建对象

I am trying to create an object for AJAX. I know who to create constructors and methods for an object, but I don't know how to do it for AJAX. My version for the constructor:

function Ajax(method, destination, send){
    this.method=method.toUpperCase();
    this.destination=destination;
    this.send=send;
}
var ajax=new Ajax('POST', '../info.html', true);

The main thing is that I don't understand how to get the results after the ReadyState==4 and the status=200. I know how to get the responseText, but I don't know how to create a method that can get the responseText and return it. Please help!

What I want to be able to do:

ajax.getResults();
  • 写回答

0条回答 默认 最新

    报告相同问题?