需求:对Ajax进行简单的封装,请求开始时屏幕正中央要显示正在加载,请求结束时取消显示,可设置请求超时的时间,在开发期间可以看到详细的调用日志,xmlhttprequest的status/responseText,正式部署上线时,可以取消日志的输出。

 

palmajax.js

 

 

调用步骤如下:


// first step
MyAssitant.prototype.setup = function()
{
    
this.palmAjax = new PalmAjax(this.controller);
}
// second step
MyAssistant.prototype.handlerAjax = function()
{
    
this.palmAjax.send({url : url, parameters : parameters});
}

相关文章:

  • 2021-09-17
  • 2021-08-22
  • 2021-04-02
  • 2022-01-16
  • 2022-01-08
  • 2022-01-17
  • 2021-06-19
猜你喜欢
  • 2021-08-14
  • 2021-08-17
  • 2022-02-13
  • 2022-12-23
  • 2022-02-23
  • 2021-09-04
  • 2022-02-10
相关资源
相似解决方案