Unlock instant, AI-driven research and patent intelligence for your innovation.

A method for simplifying and restricting concurrent ajax requests

A conversion and queue technology, applied in the field of Web program development, can solve problems such as shortage, and achieve the effect of easy processing, simple and efficient ajax request control mode

Active Publication Date: 2017-03-22
G CLOUD TECH
View PDF1 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 1. There is a lack of a mechanism to limit concurrent ajax requests, which often requires developers to develop by themselves

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method for simplifying and restricting concurrent ajax requests
  • A method for simplifying and restricting concurrent ajax requests
  • A method for simplifying and restricting concurrent ajax requests

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0026] The first step is to organize the ajax request queue and parameters. The parameters are as follows:

[0027]

[0028] Use the above-mentioned parameter config to call the function encapsulated in the present invention (compatible with AMD, commonJS, var and other introduction methods, described in the simplest var method) rbAjax(config).

[0029] In the second step, use config to call the internal _dequeue method, the process is as follows:

[0030] (1) Use config.queue.splice(0, config.limit) to extract the parameters of the first two ajax requests in the queue.

[0031] (2) Traverse the extracted ajax parameters and execute the following logic: merge the incoming parameters with the default parameters to obtain a final parameter cache, remove the parameters not used by $.ajax, and add ajax-id to the data passed to the server by ajax , which is the id value of the current ajax. Detect whether the ajax request that the current ajax request depends on is executed su...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the technical field of Web program development, in particular a method for simplifying and restricting concurrent ajax requests. The method is characterized by: converting concurrent ajax requests into a first-in first-out queue form and setting a unique id for each request; taking out n ajax requests from the queue and executing the same at a time, and executing corresponding methods in the queue after each ajax request is executed; caching current ajax request states and data; continuing to take out and execute n ajax requests after the taken-out n ajax requests are executed until all the ajax requests are executed and total callback is executed. The method solves the problems that there is lack of a restricting mechanism in concurrent ajax requests and callback modes need to be compiled; the method is especially suitable for constructing web programs embodied by rich users.

Description

technical field [0001] The invention relates to the technical field of web program development, in particular to a method for simplifying and limiting concurrent ajax requests. Background technique [0002] In recent years, with the development of front-end technology and the emphasis on user performance of programs, the traditional B / S development model is difficult to meet the development needs of the Internet. More and more developers use javascript to build complex web programs with rich user performance. The most important method for javascript to interact with the server is ajax, and concurrent ajax requests are often encountered in complex projects. [0003] The conventional ajax request method has the following problems: [0004] 1. There is a lack of a mechanism to limit concurrent ajax requests, which often requires developers to develop by themselves. [0005] 2. To process ajax requests with dependencies, it is often necessary to write complex and difficult-to-...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/45G06F9/38
CPCG06F8/445G06F9/3856
Inventor 陈健豪李勇波孙傲冰季统凯
Owner G CLOUD TECH