全局搜索结果(7)

  • 代码片段奇怪的js,用 let 加持修正结果
  • 2021/4/29 14:11:06
  • for (var i = 0; i < 10; i++) { setTimeout(function () { console.log(i); }, 0) }你知道上面会输出上面结果吗???会是0到9都打印一遍吗?错,上面会输出10个10,因为执行到setTimeout的时候,外循环已经执行完,并且在循环最大值的时候还执行了个+1操作,所以会输出10个10,而不是10个9。问题:那么如何能让上面的结果输出我们想要的0-9呢?解决方案:只需要将变量定义方式var修改为let即可,如下:for (let i = 0; i < 10; i++) { setTimeout(function () { console.log(i); }, 0) }以上输出结果为:0,1,2,3,4,5,6,7,8,9
  • 评论:0 / 阅读:1141
  • 技术文摘typescript 引入layui 之 layui.d.ts
  • 2021/4/30 15:46:19
  • declare module layui { type LayerCallbackSuccess = null | ((layero: JQuery, index: number) => void); type LayerCallbackYes = null | ((index: number, layero: JQuery) => boolean | void); type LayerCallbackCancel = null | ((index: number, layero: JQuery) => boolean | void); type LayerCallbackEnd = null | (() => void); type LayerCallbackFull = null | ((layero: JQuery) => void); type LayerCallbackMin = null | ((layero: JQuery) => void); type LayerCallbackRestore = null | ((layero: JQuery) => void); type LayerCallbackPrompt = null | ((value: string, index: number, elem: JQuery) => void); /** * Layer options */ interface LayerOptions { type?: number; title?: string | boolean | string[]; content?: string | HTMLElement | JQuery | string[]; skin?: string; area?: string | string[]; offset?: number | string | string[]; icon?: number; btn?: string | string[]; closeBtn?: string | boolean; shade?: string | boolean | (number | string)[]; shadeClose?: boolean; time?: number; id?: string; anim?: number; isOutAnim?: boolean; maxmin?: boolean; fixed?: boolean; resize?: boolean; resizing?: Function; scrollbar?: boolean; maxWidth?: number; zIndex?: number; move?: string | boolean | HTMLElement; moveType?: boolean; moveOut?: boolean; moveEnd?: null | (() => void); tips?: number | (number | string)[]; tipsMore?: boolean; success?: LayerCallbackSuccess; yes?: LayerCallbackYes; btn2?: LayerCallbackYes; btn3?: LayerCallbackYes; cancel?: LayerCallbackCancel; end?: LayerCallbackEnd; full?: LayerCallbackFull; min?: LayerCallbackMin; restore?: LayerCallbackRestore; } interface LayerConfigOptions extends LayerOptions { path?: string; extend?: string[]; } interface LayerPromptOptions extends LayerOptions { formType?: number; value?: string; maxlength?: number; area?: string[]; } interface LayerTabOptions extends LayerOptions { tab: ({ title: string, content: string })[]; } interface LayerPhotosOptions extends LayerOptions { photos: LayerPhotosData | string; tab?: (pic: LayerPhotosDataItem, layero: JQuery) => void; } interface LayerPhotosData { title: string; id: number; start?: number; data: LayerPhotosDataItem[]; } interface LayerPhotosDataItem { alt: string; pid?: number; src: string; thumb: string; } /** * Layer object */ interface Layer { /** * 初始化全局配置 * @param {LayerConfigOptions} options; */ config(options: LayerConfigOptions): void; /** * 初始化就绪 * @param {string} path * @param {Function} callback */ ready(path: string, callback: () => void): void; /** * 初始化就绪 * @param {Function} callback */ ready(callback: () => void): void; /** * 原始核心方法 * @param {LayerOptions} options */ open(options?: LayerOptions): number; /** * 普通信息框 * @param {string} content * @param {LayerOptions} options * @param {Function} yes */ alert(content: string, options?: LayerOptions, yes?: LayerCallbackYes): number; /** * 普通信息框 * @param {string} content * @param {Function} yes */ alert(content: string, yes?: LayerCallbackYes): number; confirm(content: string, options?: LayerOptions, yes?: LayerCallbackYes, cancel?: LayerCallbackCancel): number; confirm(content: string, yes?: LayerCallbackYes, cancel?: LayerCallbackCancel): number; msg(content: string, options?: LayerOptions, end?: LayerCallbackEnd): number; msg(content: string, end?: LayerCallbackEnd): number; load(icon?: number, options?: LayerOptions): number; tips(content: string, follow: string | this, options?: LayerOptions): number; close(index: number): void; closeAll(type?: 'dialog' | 'page' | 'iframe' | 'loading' | 'tips'): void; style(index: number, cssStyle: { [key: string]: string | number }): void; title(title: string, index: number): void; getChildFrame(selector: string, index: number): JQuery; getFrameIndex(windowName: string): number; iframeAuto(index: number): void; iframeSrc(index: number, url: string): void; setTop(layero: JQuery): void; full(): void; min(): void; restore(): void; prompt(options?: LayerPromptOptions, yes?: LayerCallbackPrompt): number; prompt(yes?: LayerCallbackPrompt): number; tab(options: LayerTabOptions): number; photos(options: LayerPhotosOptions): number; } interface TabOption { title: string; content: string; id: string; } interface Element { init(type?: string, filter?: string): void; on(filter: string, callback: (data: any) => any): void; tabAdd(filter: string, options: TabOption): void; tabDelete(filter: string, layid: string): void; tabChange(filter: string, layid: string): void; progress(filter: string, percent: string); render(type?: string, filter?: string): void; } interface LayFormData { elem?: HTMLElement; othis?: any; value?: string; form?: any; field?: any; } interface Form { on(event: string, callback: (data: LayFormData) => any): void; render(type?: string, filter?: string); verify(config: object); } interface PageOptions { elem: string | Object; count?: number; limit?: number; limits?: number[]; curr?: number; groups?: number; prev?: string; next?: string; first?: string; last?: string; layout?: ['count' | 'prev' | 'page' | 'next' | 'limit' | 'skip']; theme?: string; hash?: string | boolean; jump?: (obj: PageOptions, first: boolean) => void; } interface Laypage { render(options: PageOptions): any; } interface DateParam { year?: number; month?: number; date?: number; hours?: number; minutes?: number; seconds?: number; } interface DateOption { elem?: string | HTMLElement; type?: 'year' | 'month' | 'date' | 'time' | 'datetime'; range?: string | boolean; format?: string; value?: string | Date; min?: string; max?: string; trigger?: string; show?: boolean; position?: string; zIndex?: number; showBottom?: boolean; btns?: 'clear' | 'now' | 'confirm'; lang?: 'cn' | 'en'; theme?: string | 'default' | 'molv' | 'grid'; calendar?: boolean; mark?: Object; ready?: (date: DateParam) => void; change?: (value: string, date: DateParam, endDate?: DateParam) => void; done?: (value: string, date: DateParam, endDate?: DateParam) => void; } interface Laydate { render(options: DateOption): Object; set(options: DateOption): void; getEndDate(month: number, year?: number): number; } interface Layui { layer?: Layer; element?: Element; form?: Form; laydate?: Laydate; laypage?: Laypage; use(mods: string | string[], callback: (...args: any[]) => any): any; } export let layer: Layer; export let element: Element; export let form: Form; export let laydate: Laydate; export let laypage: Laypage; export let jquery: JQueryStatic; export let $: JQueryStatic //interface JQuery { // html(): string; // text(): string; //} export function use(mods: string | string[], callback: (...args: any[]) => any): any; } 如果需要layui.jquery能有智能提示,那么需要同时引用jquery.d.ts,语法如下:/// <reference path="jquery.d.ts" />jquery.d.ts 内容可查看另一篇:https://ktblog.top/jie/detail/26dd7d9f61df4d798cc
  • 评论:0 / 阅读:1409
  • 技术文摘typescript 引入jquery之 jquery.d.ts
  • 2021/4/30 15:50:45
  • // Typing for the jQuery library, version 1.7.x /* Interface for the AJAX setting that will configure the AJAX request */ interface JQueryAjaxSettings { accepts?: any; async?: boolean; beforeSend?(jqXHR: JQueryXHR, settings: JQueryAjaxSettings); cache?: boolean; complete?(jqXHR: JQueryXHR, textStatus: string); contents?: { [key: string]: any; }; contentType?: string; context?: any; converters?: { [key: string]: any; }; crossDomain?: boolean; data?: any; dataFilter?(data: any, ty: any): any; dataType?: string; error?(jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any; global?: boolean; headers?: { [key: string]: any; }; ifModified?: boolean; isLocal?: boolean; jsonp?: string; jsonpCallback?: any; mimeType?: string; password?: string; processData?: boolean; scriptCharset?: string; statusCode?: { [key: number]: any; }; success?(data: any, textStatus: string, jqXHR: JQueryXHR); timeout?: number; traditional?: boolean; type?: string; url?: string; username?: string; xhr?: any; xhrFields?: { [key: string]: any; }; } /* Interface for the jqXHR object */ interface JQueryXHR extends XMLHttpRequest { overrideMimeType(); } /* Interface for the JQuery callback */ interface JQueryCallback { add(...callbacks: any[]): any; disable(): any; empty(): any; fire(...arguments: any[]): any; fired(): boolean; fireWith(context: any, ...args: any[]): any; has(callback: any): boolean; lock(): any; locked(): boolean; removed(...callbacks: any[]): any; } /* Interface for the JQuery promise, part of callbacks */ interface JQueryPromise { always(...alwaysCallbacks: any[]): JQueryDeferred; done(...doneCallbacks: any[]): JQueryDeferred; fail(...failCallbacks: any[]): JQueryDeferred; pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryDeferred; } /* Interface for the JQuery deferred, part of callbacks */ interface JQueryDeferred extends JQueryPromise { notify(...args: any[]): JQueryDeferred; notifyWith(context: any, ...args: any[]): JQueryDeferred; pipe(doneFilter?: any, failFilter?: any, progressFilter?: any): JQueryPromise; progress(...progressCallbacks: any[]): JQueryDeferred; reject(...args: any[]): JQueryDeferred; rejectWith(context: any, ...args: any[]): JQueryDeferred; resolve(...args: any[]): JQueryDeferred; resolveWith(context: any, ...args: any[]): JQueryDeferred; state(): string; then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryDeferred; } /* Interface of the JQuery extension of the W3C event object */ interface JQueryEventObject extends Event { data: any; delegateTarget: Element; isDefaultPrevented(): boolean; isImmediatePropogationStopped(): boolean; isPropogationStopped(): boolean; namespace: string; preventDefault(): any; relatedTarget: Element; result: any; stopImmediatePropagation(); stopPropagation(); pageX: number; pageY: number; which: number; metaKey: any; } /* Collection of properties of the current browser */ interface JQueryBrowserInfo { safari: boolean; opera: boolean; msie: boolean; mozilla: boolean; version: string; } interface JQuerySupport { ajax?: boolean; boxModel?: boolean; changeBubbles?: boolean; checkClone?: boolean; checkOn?: boolean; cors?: boolean; cssFloat?: boolean; hrefNormalized?: boolean; htmlSerialize?: boolean; leadingWhitespace?: boolean; noCloneChecked?: boolean; noCloneEvent?: boolean; opacity?: boolean; optDisabled?: boolean; optSelected?: boolean; scriptEval?(): boolean; style?: boolean; submitBubbles?: boolean; tbody?: boolean; } /* Static members of jQuery (those on $ and jQuery themselves) */ interface JQueryStatic { /**** AJAX *****/ ajax(url: string, settings: JQueryAjaxSettings); ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: any, jqXHR: JQueryXHR) => any): any; ajaxPrefilter(handler: (opts: any, originalOpts: any, jqXHR: JQueryXHR) => any): any; ajaxSetup(options: any); get(url: string, data?: any, success?: any, dataType?: any): JQueryXHR; getJSON(url: string, data?: any, success?: any): JQueryXHR; getScript(url: string, success?: any): JQueryXHR; param(obj: any): string; param(obj: any, traditional: boolean): string; post(url: string, data?: any, success?: any, dataType?: any): JQueryXHR; /********* CALLBACKS **********/ Callbacks(flags: any): JQueryCallback; /**** CORE *****/ holdReady(hold: boolean): any; (selector: string, context?: any): JQuery; (element: Element): JQuery; (object: {}): JQuery; (elementArray: Element[]): JQuery; (object: JQuery): JQuery; (func: Function): JQuery; (): JQuery; noConflict(removeAll?: boolean): Object; when(...deferreds: any[]): JQueryPromise; /*** CSS ****/ css(e: any, propertyName: string, value?: any); css(e: any, propertyName: any, value?: any); cssHooks: { [key: string]: any; }; /**** DATA *****/ data(element: Element, key: string, value: any): Object; dequeue(element: Element, queueName?: string): any; hasData(element: Element): boolean; queue(element: Element, queueName?: string): any[]; queue(element: Element, queueName: string, newQueueOrCallback: any): JQuery; removeData(element: Element, name?: string): JQuery; /******* EFFECTS ********/ fx: { tick: () => void; interval: number; stop: () => void; speeds: { slow: number; fast: number; }; off: boolean; step: any; }; /****** EVENTS *******/ proxy(context: any, name: any): any; /********* INTERNALS **********/ error(message: any); /************* MISCELLANEOUS **************/ expr: any; fn: any; //TODO: Decide how we want to type this isReady: boolean; /********** PROPERTIES ***********/ browser: JQueryBrowserInfo; support: JQuerySupport; /********* UTILITIES **********/ contains(container: Element, contained: Element): boolean; each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any; extend(target: any, ...objs: any[]): Object; extend(deep: boolean, target: any, ...objs: any[]): Object; globalEval(code: string): any; grep(array: any[], func: any, invert: boolean): any[]; inArray(value: any, array: any[], fromIndex?: number): number; isArray(obj: any): boolean; isEmptyObject(obj: any): boolean; isFunction(obj: any): boolean; isNumeric(value: any): boolean; isPlainObject(obj: any): boolean; isWindow(obj: any): boolean; isXMLDoc(node: Node): boolean; makeArray(obj: any): any[]; map(array: any[], callback: (elementOfArray: any, indexInArray: any) => any): JQuery; merge(first: any[], second: any[]): any[]; noop(): any; now(): number; parseJSON(json: string): Object; //FIXME: This should return an XMLDocument parseXML(data: string): any; queue(element: Element, queueName: string, newQueue: any[]): JQuery; trim(str: string): string; type(obj: any): string; unique(arr: any[]): any[]; } /* The jQuery instance members */ interface JQuery { /**** AJAX *****/ ajaxComplete(handler: any): JQuery; ajaxError(handler: (evt: any, xhr: any, opts: any) => any): JQuery; ajaxSend(handler: (evt: any, xhr: any, opts: any) => any): JQuery; ajaxStart(handler: () => any): JQuery; ajaxStop(handler: () => any): JQuery; ajaxSuccess(handler: (evt: any, xml: any, opts: any) => any): JQuery; load(url: string, data?: any, complete?: any): JQuery; serialize(): string; serializeArray(): any[]; /********** ATTRIBUTES ***********/ addClass(classNames: string): JQuery; addClass(func: (index: any, currentClass: any) => JQuery); attr(attributeName: string): string; attr(attributeName: string, value: any): JQuery; attr(map: { [key: string]: any; }): JQuery; attr(attributeName: string, func: (index: any, attr: any) => any): JQuery; hasClass(className: string): boolean; html(htmlString: string): JQuery; html(): string; prop(propertyName: string): string; prop(propertyName: string, value: any): JQuery; prop(map: any): JQuery; prop(propertyName: string, func: (index: any, oldPropertyValue: any) => any): JQuery; removeAttr(attributeName: any): JQuery; removeClass(className?: any): JQuery; removeClass(func: (index: any, cls: any) => any): JQuery; removeProp(propertyName: any): JQuery; toggleClass(className: any, swtch?: boolean): JQuery; toggleClass(swtch?: boolean): JQuery; toggleClass(func: (index: any, cls: any, swtch: any) => any): JQuery; val(): any; val(value: string[]): JQuery; val(value: string): JQuery; val(func: (index: any, value: any) => any): JQuery; /*** CSS ****/ css(propertyName: string, value?: any); css(propertyName: any, value?: any); height(): number; height(value: number): JQuery; height(func: (index: any, height: any) => any): JQuery; innerHeight(): number; innerWidth(): number; offset(): Object; offset(coordinates: any): JQuery; offset(func: (index: any, coords: any) => any): JQuery; outerHeight(includeMargin?: boolean): number; outerWidth(includeMargin?: boolean): number; position(): { top: number; left: number; }; scrollLeft(): number; scrollLeft(value: number): JQuery; scrollTop(): number; scrollTop(value: number): JQuery; width(): number; width(value: number): JQuery; width(func: (index: any, height: any) => any): JQuery; /**** DATA *****/ clearQueue(queueName?: string): JQuery; data(key: string, value: any): JQuery; data(obj: { [key: string]: any; }): JQuery; data(key?: string): any; dequeue(queueName?: string): JQuery; removeData(nameOrList?: any): JQuery; /******** DEFERRED *********/ promise(type?: any, target?: any): JQueryPromise; /******* EFFECTS ********/ animate(properties: any, duration?: any, easing?: string, complete?: Function): JQuery; animate(properties: any, options: { duration?: any; easing?: string; complete?: Function; step?: Function; queue?: boolean; specialEasing?: any; }); delay(duration: number, queueName?: string): JQuery; fadeIn(duration?: any, callback?: any): JQuery; fadeIn(duration?: any, easing?: string, callback?: any): JQuery; fadeOut(duration?: any, callback?: any): JQuery; fadeOut(duration?: any, easing?: string, callback?: any): JQuery; fadeTo(duration: any, opacity: number, callback?: any): JQuery; fadeTo(duration: any, opacity: number, easing?: string, callback?: any): JQuery; fadeToggle(duration?: any, easing?: string, callback?: any): JQuery; hide(duration?: any, callback?: any): JQuery; hide(duration?: any, easing?: string, callback?: any): JQuery; show(duration?: any, callback?: any): JQuery; show(duration?: any, easing?: string, callback?: any): JQuery; slideDown(duration?: any, callback?: any): JQuery; slideDown(duration?: any, easing?: string, callback?: any): JQuery; slideToggle(duration?: any, callback?: any): JQuery; slideToggle(duration?: any, easing?: string, callback?: any): JQuery; slideUp(duration?: any, callback?: any): JQuery; slideUp(duration?: any, easing?: string, callback?: any): JQuery; stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; stop(queue?: any, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; toggle(duration?: any, callback?: any): JQuery; toggle(duration?: any, easing?: string, callback?: any): JQuery; toggle(showOrHide: boolean): JQuery; /****** EVENTS *******/ bind(eventType: string, eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; bind(eventType: string, preventBubble: boolean): JQuery; bind(...events: any[]); blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; blur(handler: (eventObject: JQueryEventObject) => any): JQuery; change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; change(handler: (eventObject: JQueryEventObject) => any): JQuery; click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; click(handler: (eventObject: JQueryEventObject) => any): JQuery; dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; focus(handler: (eventObject: JQueryEventObject) => any): JQuery; focusin(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; focusout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; keydown(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; keydown(handler: (eventObject: JQueryEventObject) => any): JQuery; keypress(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; keypress(handler: (eventObject: JQueryEventObject) => any): JQuery; keyup(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; keyup(handler: (eventObject: JQueryEventObject) => any): JQuery; mousedown(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mousedown(handler: (eventObject: JQueryEventObject) => any): JQuery; mouseevent(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mouseevent(handler: (eventObject: JQueryEventObject) => any): JQuery; mouseleave(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mouseleave(handler: (eventObject: JQueryEventObject) => any): JQuery; mousemove(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mousemove(handler: (eventObject: JQueryEventObject) => any): JQuery; mouseout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mouseout(handler: (eventObject: JQueryEventObject) => any): JQuery; mouseover(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mouseover(handler: (eventObject: JQueryEventObject) => any): JQuery; mouseup(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; mouseup(handler: (eventObject: JQueryEventObject) => any): JQuery; off(events?: string, selector?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; off(eventsMap: { [key: string]: any; }, selector?: any): JQuery; on(events: string, selector?: any, data?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; on(eventsMap: { [key: string]: any; }, selector?: any, data?: any): JQuery; one(events: string, selector?: any, data?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; one(eventsMap: { [key: string]: any; }, selector?: any, data?: any): JQuery; ready(handler: any): JQuery; resize(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; resize(handler: (eventObject: JQueryEventObject) => any): JQuery; scroll(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; select(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; select(handler: (eventObject: JQueryEventObject) => any): JQuery; submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; submit(handler: (eventObject: JQueryEventObject) => any): JQuery; trigger(eventType: string, ...extraParameters: any[]): JQuery; trigger(event: JQueryEventObject): JQuery; triggerHandler(eventType: string, ...extraParameters: any[]): Object; unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; unbind(eventType: string, fls: boolean): JQuery; unbind(evt: any): JQuery; undelegate(): JQuery; undelegate(selector: any, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; undelegate(selector: any, events: any): JQuery; undelegate(namespace: string): JQuery; /********* INTERNALS **********/ context: Element; jquery: string; pushStack(elements: any[]): JQuery; pushStack(elements: any[], name: any, arguments: any): JQuery; /************ MANIPULATION *************/ after(...content: any[]): JQuery; after(func: (index: any) => any); append(...content: any[]): JQuery; append(func: (index: any, html: any) => any); appendTo(target: any): JQuery; before(...content: any[]): JQuery; before(func: (index: any) => any); clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; detach(selector?: any): JQuery; empty(): JQuery; insertAfter(target: any): JQuery; insertBefore(target: any): JQuery; prepend(...content: any[]): JQuery; prepend(func: (index: any, html: any) => any): JQuery; prependTo(target: any): JQuery; remove(selector?: any): JQuery; replaceAll(target: any): JQuery; replaceWith(func: any): JQuery; text(textString: string): JQuery; text(): string; toArray(): any[]; unwrap(): JQuery; wrap(wrappingElement: any): JQuery; wrap(func: (index: any) => any): JQuery; wrapAll(wrappingElement: any): JQuery; wrapInner(wrappingElement: any): JQuery; wrapInner(func: (index: any) => any): JQuery; /************* MISCELLANEOUS **************/ each(func: (index: any, elem: Element) => JQuery); get(index?: number): any; index(selectorOrElement?: any): number; /********** PROPERTIES ***********/ length: number; //edit //[x: string]: HTMLElement; //[x: number]: HTMLElement; /********** TRAVERSING ***********/ add(selector: string, context?: any): JQuery; add(...elements: any[]): JQuery; add(html: string): JQuery; add(obj: JQuery): JQuery; andSelf(): JQuery; children(selector?: any): JQuery; closest(selector: string): JQuery; closest(selector: string, context?: Element): JQuery; closest(obj: JQuery): JQuery; closest(element: any): JQuery; closest(selectors: any, context?: Element): any[]; contents(): JQuery; end(): JQuery; eq(index: number): JQuery; filter(selector: string): JQuery; filter(func: (index: any) => any): JQuery; filter(element: any): JQuery; filter(obj: JQuery): JQuery; find(selector: string): JQuery; find(element: any): JQuery; find(obj: JQuery): JQuery; first(): JQuery; has(selector: string): JQuery; has(contained: Element): JQuery; is(selector: string): JQuery; is(func: (index: any) => any): JQuery; is(element: any): JQuery; is(obj: JQuery): JQuery; last(): JQuery; map(callback: (index: any, domElement: Element) => any): JQuery; next(selector?: string): JQuery; nextAll(selector?: string): JQuery; nextUntil(selector?: string, filter?: string): JQuery; nextUntil(element?: Element, filter?: string): JQuery; not(selector: string): JQuery; not(func: (index: any) => any): JQuery; not(element: any): JQuery; not(obj: JQuery): JQuery; offsetParent(): JQuery; parent(selector?: string): JQuery; parents(selector?: string): JQuery; parentsUntil(selector?: string, filter?: string): JQuery; parentsUntil(element?: Element, filter?: string): JQuery; prev(selector?: string): JQuery; prevAll(selector?: string): JQuery; prevUntil(selector?: string, filter?: string): JQuery; prevUntil(element?: Element, filter?: string): JQuery; siblings(selector?: string): JQuery; slice(start: number, end?: number): JQuery; /********* UTILITIES **********/ queue(queueName?: string): any[]; queue(queueName: string, newQueueOrCallback: any): JQuery; queue(newQueueOrCallback: any): JQuery; } //declare var jQuery: JQueryStatic; //declare var $: JQueryStatic;
  • 评论:0 / 阅读:1417
  • 代码片段js地址栏添加标记但不要刷新页面
  • 2021/6/22 14:52:03
  • var newUrl = location.href + '&ref=1'; history.pushState({}, document.title, newUrl);
  • 评论:0 / 阅读:1072
  • 技术文摘mvc3升级到mvc4 记录
  • 2021/6/23 18:13:49
  • 项目需要高并发,引入redis 消息队列,mvc3不支持异步controller返回视图,无奈走上了升级之路
  • ...管理器控制台,输入以下指令回车等待升级完成。Install-Package UpgradeMvc3ToMvc4 -Version 1.0.1如果解析失败可以自己下载包源到本地进行本地升级,或者更换能用的程序包源地址
  • 评论:0 / 阅读:1196
  • 经验分享高并发测试时 Jmeter 察看结果树只显示500条解决
  • 2021/6/24 9:40:09
  • ...一定要把前面的“#”号去掉,“#”号代表注释不生效。#view.results.tree.max_results=500改成如下:view.results.tree.max_results=0注意:从3.2版开始,视图中的条目数被限制为属性view.results.tree.max_results的值,该属性的默认值为500个条目.可以通过将属性设置为0来恢复原来的行为.请注意,这可能会占用大量内存.
  • 评论:0 / 阅读:1042
  • 经验分享小于4G的win7 旗舰版 纯净系统
  • 2021/7/24 10:33:17
  • Windows 7 Ultimate (x64) - DVD (Chinese-Simplified) 文件名:cn_windows_7_ultimate_x64_dvd_x15-66043.isoSHA1:4A98A2F1ED794425674D04A37B70B9763522B0D4文件大小:3.11GB下载地址:ed2k://|file|cn_windows_7_ultimate_x64_dvd_x15-66043.iso|3341268992|7DD7FA757CE6D2DB78B6901F81A6907A|/Windows 7 Ultimate (x86) - DVD (Chinese-Simplified)文件名:cn_windows_7_ultimate_x86_dvd_x15-65907.isoSHA1:B589336602E3B7E134E222ED47FC94938B04354F文件大小:2.43GB下载地址:ed2k://|file|cn_windows_7_ultimate_x86_dvd_x15-65907.iso|2604238848|D6F139D7A45E81B76199DDCCDDC4B509|/Windows 7 Ultimate with Service Pack 1 (x64) - DVD (Chinese-Simplified)文件名:cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.isoSHA1:2CE0B2DB34D76ED3F697CE148CB7594432405E23文件大小:3.19GB下载地址:ed2k://|file|cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso|3420557312|B58548681854236C7939003B583A8078|/Windows 7 Ultimate with Service Pack 1 (x86) - DVD (Chinese-Simplified)文件名:cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486.isoSHA1:B92119F5B732ECE1C0850EDA30134536E18CCCE7文件大小:2.47GB下载地址:ed2k://|file|cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486.iso|2653276160|7503E4B9B8738DFCB95872445C72AEFB|/
  • 评论:0 / 阅读:1012