用RequireJS编写JavaScript模块(2)

// post data to server using .ajax
        // handler(msg) will be callback when .ajax succeeded
        // errorHandler(jqXHR, textStatus) willl be callback if .ajax failed
        post: function (urlPath, asyncWay, dataValue, handler, errorHandler, context) {
          this.exe(urlPath, asyncWay, 'POST', dataValue, handler, errorHandler, context);
        },

// call web method with GET to server using .ajax
        // handler(msg) will be callback when .ajax succeeded
        // errorHandler(jqXHR, textStatus) willl be callback if .ajax failed
        get: function (urlPath, asyncWay, dataValue, handler, errorHandler, context) {
          this.exe(urlPath, asyncWay, 'GET', dataValue, handler, errorHandler, context);
        }
        };
      }
      );

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/f4bf10347b7c9ba690a88c0dd51cb536.html