Link Search Menu Expand Document

Ajax

ajax.ts#L140

deferredPost (url: string, data: PostData): void

Utility function to throttle repeated POST requests. A request to the same URL will be made at most every 5s, and the corresponding data objects will be deep-merged.

Name Type Default Description
url string    
data PostData    
ajax.ts#L44

fromQueryString (str: string): Obj<string>

Converts an HTML query string to JSON object.

Name Type Default Description
str string    
ajax.ts#L92

loadImage (url: string, credentials: boolean): Promise<HTMLImageElement>

Asynchronously loads an Image.

Name Type Default Description
url string    
credentials boolean false  
ajax.ts#L81

loadScript (src: string): Promise<unknown>

Asynchronously loads and executes a JS script.

Name Type Default Description
src string    
ajax.ts#L63

post (url: string, data: PostData|FormData): Promise<string>

Asynchronously loads a resource using a POST request. This utility function automatically form-encodes JSON data and adds a CSRF header.

Name Type Default Description  
url string      
data PostData FormData    
ajax.ts#L22

toQueryString (data: PostData): string

Converts a JSON object to an HTML query string.

Name Type Default Description
data PostData    

Copyright © 2021 Mathigon.org