CN104679501A - Method, device and browser for identifying operation of single page application - Google Patents
Method, device and browser for identifying operation of single page application Download PDFInfo
- Publication number
- CN104679501A CN104679501A CN201310645733.6A CN201310645733A CN104679501A CN 104679501 A CN104679501 A CN 104679501A CN 201310645733 A CN201310645733 A CN 201310645733A CN 104679501 A CN104679501 A CN 104679501A
- Authority
- CN
- China
- Prior art keywords
- webpage
- browser
- reference value
- preset
- page
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000003247 decreasing effect Effects 0.000 claims description 4
- 230000001360 synchronised effect Effects 0.000 claims 1
- 230000000052 comparative effect Effects 0.000 abstract 1
- 230000008569 process Effects 0.000 description 17
- 230000004044 response Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- User Interface Of Digital Computer (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method, device and browser for identifying operation of single page application, wherein the method comprises: when triggering operation exists in the single page application of the browser, obtain the reference value of a web page configuration parameter of the browser and the reference value of a preset web page variable parameter; compare the reference value of the web page configuration parameter and the reference value of the preset web page variable parameter; according to the comparative result, determine the type of the triggering operation. The method, device and browser can carry out fast and accurate identification to the triggering operation in the single page application of the browser, and promotes the intelligence of the browser.
Description
Technical Field
The invention relates to the technical field of internet, in particular to the technical field of browsers, and particularly relates to an operation identification method and device for single-page application and a browser.
Background
A single-page application (webapp) refers to a web-based system and application, which is an application running in a network and a standard browser that is developed based on web technology to implement a specific function. webapp is characterized in that: all effects and interactions are implemented in one html page. At present, browsers of terminal devices are provided with advance and retreat keys, and users can perform various trigger operations to trigger the browsers to make corresponding responses in the process of using single-page applications of the browsers, wherein the trigger operations can be operations of clicking browsed single-side application pages, operations of clicking the advance and retreat keys of the browsers themselves, and the like. With the wide application of the webapp, how to quickly and accurately identify the trigger operation in the webapp so that the browser can make a correct response to improve the intelligence of the browser becomes a problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides an operation identification method and device for a single-page application and a browser, which can quickly and accurately identify a trigger operation in the single-page application of the browser and improve the intelligence of the browser.
The first aspect of the present invention provides an operation identification method for a single-page application, which may include:
when trigger operation exists in a single-page application of a browser, acquiring a reference value of a webpage configuration parameter of the browser and a reference value of a preset webpage variable parameter;
comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter;
and determining the type of the trigger operation according to the comparison result.
A second aspect of the present invention provides an operation recognition apparatus for a single-page application, which may include:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a reference value of a webpage configuration parameter of a browser and a reference value of a preset webpage variable parameter when a trigger operation exists in a single-page application of the browser;
the comparison module is used for comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter;
and the identification module is used for determining the type of the trigger operation according to the comparison result.
A third aspect of the present invention provides a browser, which may include the operation recognition device for a single-page application provided in the second aspect.
The embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an operation identification method for a single-page application according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for identifying operations of a single-page application according to an embodiment of the present invention;
fig. 3 is a flowchart of another operation identification method for a single-page application according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an operation recognition device for a single-page application according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an operation recognition device for a single-page application according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of an embodiment of an obtaining module according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another embodiment of an obtaining module according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiment of the invention, a single-page application (webapp) refers to a web-based system and an application, which run in a network and a standard browser and are developed based on a web page technology to realize a specific function application. webapp is characterized in that: all effects and interactions are implemented in one html (HyperText Markup Language) page.
The operation recognition method for single-page applications according to the embodiment of the present invention will be described in detail below with reference to fig. 1 to 3. It should be noted that the operation identification method for the single-page application shown in fig. 1 to fig. 3 may be executed by an operation identification apparatus for the single-page application provided in an embodiment of the present invention, where the operation identification apparatus for the single-page application may be run in a browser of a terminal device, where the terminal device may include, but is not limited to: PC (Personal Computer), PAD (tablet Computer), mobile phone, smart phone, notebook Computer, and the like.
Referring to fig. 1, a flowchart of an operation identification method for a single-page application according to an embodiment of the present invention is shown; the method may comprise the following steps S101-S103.
S101, when trigger operation exists in single-page application of the browser, acquiring a reference value of a webpage configuration parameter of the browser and a reference value of a preset webpage variable parameter.
The triggering operation in the single-page application of the browser may include: the trigger operation is generated aiming at a link address in a page of a single-page application opened by the browser, or the trigger operation is generated aiming at a key of the browser when the browser opens the page of the single-page application.
The webpage configuration parameter of the browser can be used for representing the number of webpages recently visited by the browser. The web page configuration parameter can be expressed as history. It should be noted that, no matter the trigger operation is generated for the link address in the page of the single-page application opened by the browser, or the trigger operation is generated for the forward/backward key of the browser when the browser opens the page of the single-page application, the web page accessed by the browser is changed, so that the reference value of history.
The preset web page variable parameter can be used for reflecting the number of trigger operations generated aiming at the link address in the page of the single-page application opened by the browser. The preset web page variable parameter may be represented as x.length, and the x.length may be set in a memory, or may be set in address information of a single-page application of the browser. It should be noted that the reference value of x.length can be affected by the trigger operation generated for the link address in the page of the single-page application opened by the browser; and the trigger operation generated by the browser for the forward and backward keys when the browser opens the page of the single-page application does not affect the reference value of the X.length.
S102, comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter.
The step is mainly to compare the reference value of the webpage configuration parameter with the preset numerical value of the reference value of the webpage variable parameter, namely comparing the reference value of the length with the numerical value of the reference value of the X.length. This step may yield any of the following comparisons: (1) length is greater than x.length; (2) length is equal to x.length; (3) length reference value is less than x.length reference value.
S103, determining the type of the trigger operation according to the comparison result.
In the embodiment of the present invention, the type of the trigger operation may include: page clicking operation, page back operation or page forward operation. The page clicking operation belongs to a trigger operation generated aiming at a link address in a page of a single-page application opened by a browser, and refers to an operation that a user clicks any link address in the current page of the single-page application opened by the browser to enable the browser to open another page of the single-page application. The page back operation belongs to a trigger operation generated for a key of a browser when the browser opens a page of a single-page application, and refers to an operation that a user clicks a back key of the browser after the browser opens a current page of the single-page application, so that the browser opens a page before the current page. The page forward operation belongs to trigger operation generated for a key of a browser when the browser opens a page of a single-page application, and refers to operation that after the browser opens a current page of the single-page application, a user clicks a forward key of the browser to enable the browser to open a next page of the current page. In this step, the type of the trigger operation can be accurately determined based on the numerical comparison result of the reference value of the length and the reference value of the x.length. Specifically, in step S102, if the comparison result of the (1) th type is obtained, the step may determine that the type of the trigger operation is a page forward operation; step S102, if the comparison result of the (2) th type is obtained, the step can determine that the type of the trigger operation is a page click operation; in step S102, if the comparison result of the (3) th type is obtained, the step may determine that the type of the trigger operation is a page back operation.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
Referring to fig. 2, a flowchart of another method for identifying an operation of a single-page application according to an embodiment of the present invention is shown; the method may include the following steps S201 to S211.
S201, when a single-page application is started in a browser, reading an initial value of a webpage configuration parameter of the browser.
Length may be represented as a history. In this step, starting a single-page application in the browser refers to opening a certain page of the single-page application in the browser for the first time, at which time the value of the history.
S202, presetting webpage variable parameters in a memory or address information of the single-page application, and enabling initial values of the preset webpage variable parameters to be equal to initial values of the webpage configuration parameters.
Wherein, the preset web page variable parameter may be represented as x. The length may be set in the memory, and in a specific implementation, the length may be stored in the memory; the length may also be set in address information of a single-page application of the browser, and in a specific implementation, a variable parameter field may be added to a URL (uniform resource Locator) address of the single-page application, and the length is stored in the variable parameter field. In this step, after the x.length is set, the initial value of the history.length read in step S201 may be given to the x.length, so that the initial value of the x.length is equal to the initial value of the history.length.
S203, when the first information is monitored in the single-page application of the browser, it is confirmed that the trigger operation exists in the single-page application of the browser.
The first information pointer is used for triggering information generated when a link address in a page of a single-page application opened by a browser is operated. In this step, when the first information is monitored in the single-page application of the browser, it can be confirmed that the trigger operation exists in the single-page application of the browser. It is understood that this step may further confirm that the trigger belongs to a trigger generated for a link address in a page of a single page application opened by the browser.
S204, setting the initial value of the preset webpage variable parameter as a basic value, and increasing the basic value of the preset webpage variable parameter by a preset numerical value to obtain the reference value of the preset webpage variable parameter.
S205, updating the address information of the single-page application in the browser, enabling the browser to set the initial value of the webpage configuration parameter as a basic value, and synchronously increasing the basic value of the webpage configuration parameter by the preset value to obtain the reference value of the webpage configuration parameter.
In steps S204 to S205, the preset value may be set according to actual needs, for example: the preset values may be set to 1, 2, etc. It should be noted that, after the preset value is set, when the preset webpage variable parameter (i.e., x.length) and the webpage configuration parameter (i.e., history.length) of the browser have a numerical change, both the x.length and the history.length increase or decrease the basic value by using the preset value as a step length to obtain the reference value.
S206, acquiring the reference value of the webpage configuration parameter and the reference value of the preset webpage variable parameter.
Steps S203 to S206 of the present embodiment may be detailed refinement steps of step S101 of the embodiment shown in fig. 1.
S207, comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter.
This step can be referred to step S102 in the embodiment shown in fig. 1, and is not described herein again. This step may produce any of the following comparisons: (1) length is greater than x.length; if the comparison result is obtained, the step can be subsequently transferred to step S210; (2) the reference value of length is equal to the reference value of x.length, and if the comparison result is obtained, the process may subsequently proceed to step S208; (3) the reference value of length is smaller than the reference value of x.length, and if the comparison result is obtained, the process may proceed to step S209.
S208, if the reference value of the webpage configuration parameter is equal to the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page click operation; thereafter, the process proceeds to step S211.
S209, if the reference value of the webpage configuration parameter is smaller than the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page back operation; thereafter, the process proceeds to step S211.
S210, if the reference value of the webpage configuration parameter is larger than the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page forward operation; thereafter, the process proceeds to step S211.
In steps S208 to S210, since the trigger operation generated for the link address in the page of the one-page application opened by the browser affects the reference value of history. Since the trigger operation generated for the key of the browser when the browser opens the page of the single-page application may affect the reference value of the history. Further, in step S209, if the reference value of history. In step S210, if the reference value of the history.
Steps S208 to S210 of the present embodiment may be a detailed refinement of step S103 of the embodiment shown in fig. 1.
S211, updating the basic value of the webpage configuration parameter by adopting the reference value of the webpage configuration parameter; and updating the basic value of the preset webpage variable parameter by adopting the reference value of the preset webpage variable parameter.
After determining the type of trigger operation in steps S208-S210, this step updates the base value of the history.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
Referring to fig. 3, a flowchart of another operation identification method for a single-page application according to an embodiment of the present invention is shown; the method may comprise the following steps S301-S310.
S301, when a single-page application is started in a browser, reading an initial value of a webpage configuration parameter of the browser.
S302, presetting a webpage variable parameter in a memory or address information of the single-page application, and enabling an initial value of the preset webpage variable parameter to be equal to an initial value of the webpage configuration parameter.
Steps S301 to S302 of this embodiment can refer to steps S201 to S202 of the embodiment shown in fig. 2, which are not described herein again. Length, the webpage configuration parameters can be represented as history; the preset web page variable parameter may be expressed as x.
S303, when the second information sent by the browser is received, it is confirmed that the trigger operation exists in the single-page application of the browser.
The second information refers to information sent by the browser when the browser performs triggering operation on a forward and backward key of the browser when the browser opens a page of the single-page application. In this step, when the second information is received, it can be confirmed that the trigger operation exists in the single page application of the browser. It is understood that this step may further confirm that the trigger operation belongs to a trigger operation generated for a forward/backward key of the browser when the browser opens a page of the single-page application.
S304, setting the initial value of the preset webpage variable parameter as a basic value, and determining the basic value of the preset webpage variable parameter as the reference value of the preset webpage variable parameter.
S305, obtaining a reference value of the webpage configuration parameter and a reference value of the preset webpage variable parameter, wherein the reference value of the webpage configuration parameter is obtained by setting an initial value of the webpage configuration parameter as a basic value by the browser and increasing or decreasing the basic value of the webpage configuration parameter by the preset value according to the triggering operation.
It should be noted that, if the triggering operation is a triggering operation generated by a back key for the browser when the browser opens a page of the single-page application, the browser sets an initial value of the history. If the triggering operation is the triggering operation generated by a forward key of the browser when the browser opens a page of the single-page application, the browser sets an initial value of the history.
Steps S303 to S305 of the present embodiment may be a detailed refinement of step S101 of the embodiment shown in fig. 1.
S306, comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter.
S307, if the reference value of the webpage configuration parameter is equal to the reference value of the preset webpage variable parameter, determining the type of the triggering operation as a page clicking operation.
And S308, if the reference value of the webpage configuration parameter is smaller than the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page back operation.
S309, if the reference value of the webpage configuration parameter is larger than the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page forward operation.
S310, updating the basic value of the webpage configuration parameter by adopting the reference value of the webpage configuration parameter; and updating the basic value of the preset webpage variable parameter by adopting the reference value of the preset webpage variable parameter.
Step S306 to step S310 of this embodiment can refer to step S207 to step S211 of the embodiment shown in fig. 2, which is not described herein again.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
The operation recognition apparatus for a single-page application according to an embodiment of the present invention will be described in detail with reference to fig. 4 to 7. It should be noted that the operation recognition device for the single-page application shown in fig. 4-fig. 7 can be run in a browser of a terminal device, and is used for executing the operation recognition method for the single-page application shown in fig. 1-fig. 3. Wherein the terminal devices may include but are not limited to: PC, PAD, cell-phone, smart mobile phone, notebook computer etc..
Fig. 4 is a schematic structural diagram of an operation recognition device for single-page applications according to an embodiment of the present invention; the apparatus may include: an acquisition module 101, a comparison module 102 and a recognition module 103.
The acquiring module 101 is configured to acquire a reference value of a webpage configuration parameter of a browser and a reference value of a preset webpage variable parameter when a trigger operation exists in a single-page application of the browser.
The triggering operation in the single-page application of the browser may include: the trigger operation is generated aiming at a link address in a page of a single-page application opened by the browser, or the trigger operation is generated aiming at a key of the browser when the browser opens the page of the single-page application.
The webpage configuration parameter of the browser can be used for representing the number of webpages recently visited by the browser. The web page configuration parameter can be expressed as history. It should be noted that, no matter the trigger operation is generated for the link address in the page of the single-page application opened by the browser, or the trigger operation is generated for the forward/backward key of the browser when the browser opens the page of the single-page application, the web page accessed by the browser is changed, so that the reference value of history.
The preset web page variable parameter can be used for reflecting the number of trigger operations generated aiming at the link address in the page of the single-page application opened by the browser. The preset web page variable parameter may be represented as x.length, and the x.length may be set in a memory, or may be set in address information of a single-page application of the browser. It should be noted that the reference value of x.length can be affected by the trigger operation generated for the link address in the page of the single-page application opened by the browser; and the trigger operation generated by the browser for the forward and backward keys when the browser opens the page of the single-page application does not affect the reference value of the X.length.
A comparing module 102, configured to compare the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter.
The comparing module 102 is mainly configured to compare the reference value of the webpage configuration parameter with the preset reference value of the webpage variable parameter, that is, compare the reference value of length with the reference value of x.length. The comparison module 102 may obtain any one of the following comparison results: (1) length is greater than x.length; (2) length is equal to x.length; (3) length reference value is less than x.length reference value.
And the identification module 103 is configured to determine the type of the trigger operation according to the comparison result.
In the embodiment of the present invention, the type of the trigger operation may include: page clicking operation, page back operation or page forward operation. The page clicking operation belongs to a trigger operation generated aiming at a link address in a page of a single-page application opened by a browser, and refers to an operation that a user clicks any link address in the current page of the single-page application opened by the browser to enable the browser to open another page of the single-page application. The page back operation belongs to a trigger operation generated for a key of a browser when the browser opens a page of a single-page application, and refers to an operation that a user clicks a back key of the browser after the browser opens a current page of the single-page application, so that the browser opens a page before the current page. The page forward operation belongs to trigger operation generated for a key of a browser when the browser opens a page of a single-page application, and refers to operation that after the browser opens a current page of the single-page application, a user clicks a forward key of the browser to enable the browser to open a next page of the current page. The recognition module 103 can accurately determine the type of the trigger operation based on the result of the numerical comparison between the reference value of the length and the reference value of the x.length. Specifically, if the comparison module 102 obtains the (1) th comparison result, the identification module 103 may determine that the type of the trigger operation is a page forward operation; if the comparison module 102 obtains the comparison result of the (2) th type, the identification module 103 may determine that the type of the trigger operation is a page click operation; if the comparison module 102 obtains the comparison result of the (3) th type, the identification module 103 may determine that the type of the trigger operation is a page back operation.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
Fig. 5 is a schematic structural diagram of another operation identification apparatus for single-page applications according to an embodiment of the present invention; the apparatus may include: an acquisition module 101, a comparison module 102, a recognition module 103, an initialization module 104, and an update module 105. The structures of the obtaining module 101, the comparing module 102 and the identifying module 103 can refer to the related description of the embodiment shown in fig. 4, and are not described herein again.
The initialization module 104 is configured to, when a single-page application is started in a browser, read an initial value of a webpage configuration parameter of the browser, and preset a webpage variable parameter in a memory or address information of the single-page application, so that the initial value of the preset webpage variable parameter is equal to the initial value of the webpage configuration parameter.
Length, the webpage configuration parameters can be represented as history; the preset web page variable parameter may be expressed as x. Starting a single-page application in a browser refers to opening a certain page of the single-page application in the browser for the first time, the initialization module 104 may read a value of history. The x.length may be set in the memory, and in a specific implementation, the x.length may be stored in the memory; the length may also be set in the address information of the single-page application of the browser, and in a specific implementation, a variable parameter field may be added to the URL address of the single-page application, and the length is stored in the variable parameter field. After setting the x.length, the initialization module 104 may assign the read initial value of the history.length to the x.length, so that the initial value of the x.length is equal to the initial value of the history.length.
An updating module 105, configured to update the basic value of the web page configuration parameter with the reference value of the web page configuration parameter; and updating the basic value of the preset webpage variable parameter by adopting the reference value of the preset webpage variable parameter.
The updating module 105 updates the basic value of the history.length by using the reference value of the history.length, and updates the basic value of the x.length by using the reference value of the x.length, so that the reference value of the history.length becomes a new basic value of the history.length, and the reference value of the x.length becomes a new basic value of the x.length, so as to be applied to performing operation recognition on a trigger operation appearing again in a single-page application of the browser.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
The structure and function of each module of the operation recognition apparatus for single-page applications according to the embodiment of the present invention will be described in detail with reference to fig. 6 to 7.
Fig. 6 is a schematic structural diagram of an embodiment of an obtaining module according to an embodiment of the present invention; the acquisition module 101 may include: a first confirming unit 1101, a first parameter processing unit 1102, a synchronization processing unit 1103, and a first acquiring unit 1104.
A first confirming unit 1101, configured to confirm that a trigger operation exists in a single page application of the browser when first information is monitored in the single page application of the browser.
The first information pointer is used for triggering information generated when a link address in a page of a single-page application opened by a browser is operated. When the first confirming unit 1101 monitors the first information in the single page application of the browser, it may confirm that the trigger operation exists in the single page application of the browser. It is understood that the first confirming unit 1101 may further confirm that the trigger operation belongs to a trigger operation generated for a link address in a page of a single page application opened by a browser.
The first parameter processing unit 1102 is configured to increase the initial value of the preset web page variable parameter by a preset value, and obtain a reference value of the preset web page variable parameter.
A synchronization processing unit 1103, configured to update the address information of the single-page application in the browser, so that the browser sets the initial value of the web page configuration parameter as a basic value, and synchronously increases the basic value of the web page configuration parameter by the preset value to obtain a reference value of the web page configuration parameter.
Wherein, preset numerical value can be set according to actual need, for example: the preset values may be set to 1, 2, etc. It should be noted that, when the preset web page variable parameter (i.e. x.length) and the web page configuration parameter (i.e. history.length) of the browser are changed in value after the preset value is set,
both the length and the store length increase or decrease the base value by using the preset value as a step size to obtain a reference value.
A first obtaining unit 1104, configured to obtain a reference value of the web page configuration parameter and a reference value of the preset web page variable parameter.
It should be noted that, in this embodiment, the identification module 103 is specifically configured to determine that the type of the trigger operation is a page click operation when the reference value of the web page configuration parameter is equal to the reference value of the preset web page variable parameter; or, the method is used for determining the type of the triggering operation as a page back operation when the reference value of the webpage configuration parameter is smaller than the reference value of the preset webpage variable parameter; or, the method is used for determining that the type of the trigger operation is a page forward operation when the reference value of the webpage configuration parameter is greater than the reference value of the preset webpage variable parameter.
Since the trigger operation generated for the link address in the page of the one-page application opened by the browser may affect the reference value of the history. Since the trigger operation generated for the button of the browser when the browser opens the page of the single-page application may affect the reference value of the history. Further, if the reference value of the history. If the reference value of history.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
Fig. 7 is a schematic structural diagram of another embodiment of an obtaining module according to an embodiment of the present invention; the acquisition module 101 may include: a second confirmation unit 1111, a second parameter processing unit 1112, and a second acquisition unit 1113.
A second confirming unit 1111, configured to confirm that a trigger operation exists in a single-page application of the browser when receiving the second information sent by the browser.
The second information refers to information sent by the browser when the browser performs triggering operation on a forward and backward key of the browser when the browser opens a page of the single-page application. The second confirming unit 1111, upon receiving the second information, may confirm that there is a trigger operation in the single page application of the browser. It is understood that the second confirming unit 1111 may further confirm that the trigger operation belongs to a trigger operation generated for a forward/backward key of the browser when the browser opens a page of the single-page application.
A second parameter processing unit 1112, configured to set an initial value of the preset web page variable parameter as a base value, and determine the base value of the preset web page variable parameter as a reference value of the preset web page variable parameter.
A second obtaining unit 1113, configured to obtain a reference value of the web page configuration parameter and a reference value of the preset web page variable parameter, where the reference value of the web page configuration parameter is obtained by setting, by the browser, an initial value of the web page configuration parameter as a basic value, and increasing or decreasing the basic value of the web page configuration parameter by the preset value according to the triggering operation.
It should be noted that, if the triggering operation is a triggering operation generated by a back key for the browser when the browser opens a page of the single-page application, the browser sets an initial value of the history. If the triggering operation is the triggering operation generated by a forward key of the browser when the browser opens a page of the single-page application, the browser sets an initial value of the history.
It should be noted that, in this embodiment, the identification module 103 is specifically configured to determine that the type of the trigger operation is a page click operation when the reference value of the web page configuration parameter is equal to the reference value of the preset web page variable parameter; or, the method is used for determining the type of the triggering operation as a page back operation when the reference value of the webpage configuration parameter is smaller than the reference value of the preset webpage variable parameter; or, the method is used for determining that the type of the trigger operation is a page forward operation when the reference value of the webpage configuration parameter is greater than the reference value of the preset webpage variable parameter.
Since the trigger operation generated for the link address in the page of the one-page application opened by the browser may affect the reference value of the history. Since the trigger operation generated for the button of the browser when the browser opens the page of the single-page application may affect the reference value of the history. Further, if the reference value of the history. If the reference value of history.
In the embodiment of the invention, the type of the trigger operation in the single-page application of the browser can be determined according to the numerical comparison result of the reference value of the webpage configuration parameter of the browser and the reference value of the preset webpage variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
The embodiment of the present invention further discloses a browser, where the browser may include an operation identification device for single-page application, and the operation identification device for single-page application may refer to the related description of the embodiments shown in fig. 4 to fig. 7, which is not described herein again. It should be noted that the browser of the present embodiment can be applied to the methods shown in fig. 1 to fig. 3.
Through the description of the embodiment, in the embodiment of the present invention, the type of the trigger operation in the single-page application of the browser may be determined according to the numerical comparison result between the reference value of the web page configuration parameter of the browser and the reference value of the preset web page variable parameter; the operation identification process is simple and easy to implement, and the identification result of the trigger operation can be quickly, effectively and accurately obtained, so that the browser can quickly make correct response aiming at the trigger operation, and the intelligence of the browser is improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.
Claims (13)
1. An operation identification method for a single-page application is characterized by comprising the following steps:
when trigger operation exists in a single-page application of a browser, acquiring a reference value of a webpage configuration parameter of the browser and a reference value of a preset webpage variable parameter;
comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter;
and determining the type of the trigger operation according to the comparison result.
2. The method of claim 1, wherein before obtaining the reference value of the web page configuration parameter and the reference value of the preset web page variable parameter of the browser when the trigger operation exists in the single-page application of the browser, the method further comprises:
when a single-page application is started in a browser, reading an initial value of a webpage configuration parameter of the browser;
presetting a webpage variable parameter in a memory or address information of the single-page application, and enabling an initial value of the preset webpage variable parameter to be equal to an initial value of the webpage configuration parameter.
3. The method of claim 2, wherein when there is a trigger operation in a single-page application of a browser, acquiring a reference value of a web page configuration parameter and a reference value of a preset web page variable parameter of the browser comprises:
when first information is monitored in the single-page application of the browser, confirming that a trigger operation exists in the single-page application of the browser;
setting the initial value of the preset webpage variable parameter as a basic value, and increasing the basic value of the preset webpage variable parameter by a preset value to obtain a reference value of the preset webpage variable parameter;
updating the address information of the single-page application in the browser, enabling the browser to set the initial value of the webpage configuration parameter as a basic value, and synchronously increasing the basic value of the webpage configuration parameter by the preset value to obtain a reference value of the webpage configuration parameter;
and acquiring the reference value of the webpage configuration parameter and the reference value of the preset webpage variable parameter.
4. The method of claim 2, wherein when there is a trigger operation in a single-page application of a browser, acquiring a reference value of a web page configuration parameter and a reference value of a preset web page variable parameter of the browser comprises:
when second information sent by the browser is received, confirming that trigger operation exists in the single-page application of the browser;
setting the initial value of the preset webpage variable parameter as a basic value, and determining the basic value of the preset webpage variable parameter as a reference value of the preset webpage variable parameter;
and acquiring a reference value of the webpage configuration parameter and a reference value of the preset webpage variable parameter, wherein the reference value of the webpage configuration parameter is obtained by setting an initial value of the webpage configuration parameter as a basic value by the browser and increasing or decreasing the basic value of the webpage configuration parameter by the preset value according to the triggering operation.
5. The method of claim 3 or 4, wherein said determining the type of the trigger operation based on the comparison comprises:
if the reference value of the webpage configuration parameter is equal to the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page click operation;
if the reference value of the webpage configuration parameter is smaller than the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page back operation;
and if the reference value of the webpage configuration parameter is larger than the reference value of the preset webpage variable parameter, determining the type of the trigger operation as a page forward operation.
6. The method of claim 3 or 4, wherein after determining the type of the trigger operation based on the comparison, further comprising:
updating the basic value of the webpage configuration parameter by adopting the reference value of the webpage configuration parameter; and the number of the first and second groups,
and updating the basic value of the preset webpage variable parameter by adopting the reference value of the preset webpage variable parameter.
7. An operation recognition apparatus for a single-page application, comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a reference value of a webpage configuration parameter of a browser and a reference value of a preset webpage variable parameter when a trigger operation exists in a single-page application of the browser;
the comparison module is used for comparing the reference value of the webpage configuration parameter with the reference value of the preset webpage variable parameter;
and the identification module is used for determining the type of the trigger operation according to the comparison result.
8. The apparatus of claim 7, further comprising:
the initialization module is used for reading an initial value of a webpage configuration parameter of the browser when the single-page application is started in the browser, and presetting a webpage variable parameter in a memory or address information of the single-page application to enable the initial value of the preset webpage variable parameter to be equal to the initial value of the webpage configuration parameter.
9. The apparatus of claim 8, wherein the acquisition module comprises:
the first confirming unit is used for confirming that trigger operation exists in the single-page application of the browser when first information is monitored in the single-page application of the browser;
the first parameter processing unit is used for increasing the initial value of the preset webpage variable parameter by a preset value to obtain a reference value of the preset webpage variable parameter;
a synchronous processing unit, configured to update address information of the single-page application in the browser, so that the browser sets an initial value of the web page configuration parameter as a basic value, and synchronously increases the basic value of the web page configuration parameter by the preset value to obtain a reference value of the web page configuration parameter;
and the first acquisition unit is used for acquiring the reference value of the webpage configuration parameter and the reference value of the preset webpage variable parameter.
10. The apparatus of claim 8, wherein the acquisition module comprises:
the second confirming unit is used for confirming that the trigger operation exists in the single-page application of the browser when receiving second information sent by the browser;
the second parameter processing unit is used for setting the initial value of the preset webpage variable parameter as a basic value and determining the basic value of the preset webpage variable parameter as a reference value of the preset webpage variable parameter;
and the second obtaining unit is used for obtaining a reference value of the webpage configuration parameter and a reference value of the preset webpage variable parameter, wherein the reference value of the webpage configuration parameter is obtained by setting an initial value of the webpage configuration parameter as a basic value by the browser and increasing or decreasing the basic value of the webpage configuration parameter by the preset value according to the triggering operation.
11. The apparatus according to claim 9 or 10, wherein the identification module is specifically configured to determine that the type of the trigger operation is a page click operation when the reference value of the web page configuration parameter is equal to the reference value of the preset web page variable parameter; or,
the method comprises the steps of determining the type of the triggering operation as a page back operation when the reference value of the webpage configuration parameter is smaller than the reference value of the preset webpage variable parameter; or,
and determining the type of the trigger operation as a page forward operation when the reference value of the webpage configuration parameter is larger than the reference value of the preset webpage variable parameter.
12. The apparatus of claim 9 or 10, further comprising:
the updating module is used for updating the basic value of the webpage configuration parameter by adopting the reference value of the webpage configuration parameter; and updating the basic value of the preset webpage variable parameter by adopting the reference value of the preset webpage variable parameter.
13. A browser, characterized by comprising operation recognition means of a single-page application according to any one of claims 7 to 12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310645733.6A CN104679501B (en) | 2013-12-03 | 2013-12-03 | A kind of operation recognition methods, device and the browser of single page application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310645733.6A CN104679501B (en) | 2013-12-03 | 2013-12-03 | A kind of operation recognition methods, device and the browser of single page application |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104679501A true CN104679501A (en) | 2015-06-03 |
CN104679501B CN104679501B (en) | 2019-07-16 |
Family
ID=53314619
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310645733.6A Active CN104679501B (en) | 2013-12-03 | 2013-12-03 | A kind of operation recognition methods, device and the browser of single page application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104679501B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101546248A (en) * | 2009-05-05 | 2009-09-30 | 阿里巴巴集团控股有限公司 | Method and device for presenting cascade option menu |
CN103019541A (en) * | 2012-11-27 | 2013-04-03 | 广东欧珀移动通信有限公司 | Single-smart key implementing method, device and mobile terminal |
CN103218156A (en) * | 2013-02-28 | 2013-07-24 | 广东欧珀移动通信有限公司 | Method for realizing multi-Tab page switching and touch type mobile terminal thereof |
-
2013
- 2013-12-03 CN CN201310645733.6A patent/CN104679501B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101546248A (en) * | 2009-05-05 | 2009-09-30 | 阿里巴巴集团控股有限公司 | Method and device for presenting cascade option menu |
CN103019541A (en) * | 2012-11-27 | 2013-04-03 | 广东欧珀移动通信有限公司 | Single-smart key implementing method, device and mobile terminal |
CN103218156A (en) * | 2013-02-28 | 2013-07-24 | 广东欧珀移动通信有限公司 | Method for realizing multi-Tab page switching and touch type mobile terminal thereof |
Also Published As
Publication number | Publication date |
---|---|
CN104679501B (en) | 2019-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3518124A1 (en) | Webpage rendering method and related device | |
CN109857327B (en) | Information processing apparatus, information processing method, and storage medium | |
US10198410B2 (en) | Method, device and mobile terminal for restoring page | |
CN104572843B (en) | The loading method and device of a kind of page | |
US8527862B2 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
CN106649543B (en) | Method, device and terminal for recording reading progress | |
US20150278173A1 (en) | Method, apparatus, terminal, and storage medium for image processing | |
EP2755145A1 (en) | Webpage browsing method and device, and storage medium | |
CN112685671A (en) | Page display method, device, equipment and storage medium | |
CN107679214B (en) | Link positioning method, device, terminal and computer readable storage medium | |
CN102664925B (en) | A kind of method of displaying searching result and device | |
CN110765208B (en) | Data synchronization method and device, electronic equipment and storage medium | |
CN109522500B (en) | Webpage display method, device, terminal and storage medium | |
WO2014154033A1 (en) | Method and apparatus for extracting web page content | |
CN106202578A (en) | A kind of browser local information synchronization processing method and device | |
CN101751462A (en) | Network information storage and access methods, equipment and terminals | |
US10775966B2 (en) | Customizable autocomplete option | |
US9875316B2 (en) | Identifying user selection using coordinates and snapshots of webpages | |
CN107480218B (en) | Webpage display method and device, electronic equipment and storage medium | |
CN106970848B (en) | Input control method and device and electronic equipment | |
WO2015058614A1 (en) | Bookmark storage method and device, and method and device for determining bookmark to be browsed | |
EP2998885A1 (en) | Method and device for information search | |
CN112433784A (en) | Page loading method, device, equipment and storage medium | |
CN104679501B (en) | A kind of operation recognition methods, device and the browser of single page application | |
CN111124530A (en) | Method and device for calculating first rendering time of browser, browser and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |