interface JQuery { /** * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. * * @param handler The function to be invoked. */ ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; /** * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; /** * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; /** * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxStart(handler: () => any): JQuery; /** * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. * * @param handler The function to be invoked. */
jquery是用javascript封装的类. 引入一下就能用了
那再问下哦,
export interface IPage {
container: JQuery;
html: string;
pageName: string;
pageTitle: string;
}
那这里的这个container有啥用呢?完全没看的,变量又不是变量,类又不是类,方法又不是方法,申明的来有啥用?
@你猜丶: container是主体的意思, 声明是用jquery这个类库
@河畔:
$(templSelector, page.container).each(function (index, templ) {});
那我能再问最后一个问题吗,他在这里作为第二个参数有何用呢?
@你猜丶: 这边引入的可能不止jquery一个类库, 防止冲突,所以指定类库是jquery. 一般直接引用是不用写的,你这边可能是自己封装了其他类.