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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 chaquopy python 安卓
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 有没有帮写代码做实验仿真的
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥30 vmware exsi重置后登不上
    • ¥15 易盾点选的cb参数怎么解啊
    • ¥15 MATLAB运行显示错误,如何解决?
    • ¥15 c++头文件不能识别CDialog
    • ¥15 Excel发现不可读取的内容
    • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题