CN104679501B - A kind of operation recognition methods, device and the browser of single page application - Google Patents
A kind of operation recognition methods, device and the browser of single page application Download PDFInfo
- Publication number
- CN104679501B CN104679501B CN201310645733.6A CN201310645733A CN104679501B CN 104679501 B CN104679501 B CN 104679501B CN 201310645733 A CN201310645733 A CN 201310645733A CN 104679501 B CN104679501 B CN 104679501B
- Authority
- CN
- China
- Prior art keywords
- reference value
- browser
- value
- parameter
- web 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.)
- Active
Links
Landscapes
- User Interface Of Digital Computer (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses operation recognition methods, device and the browsers of a kind of application of single page, method therein can include: when there are the reference values of the reference value for the webpage configuration parameter for when trigger action, obtaining the browser and preset web page variable parameter in the application of the single page of browser;The reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter is compared;According to the comparison result, the type of the trigger action is determined.The present invention can rapidly and accurately identify the trigger action in the application of the single page of browser, promote the intelligence of browser.
Description
Technical field
The present invention relates to Internet technical fields, and in particular to browser technology field more particularly to a kind of single page application
Operation recognition methods, device and browser.
Background technique
Single page refers to system and application based on web using (webapp), is that one kind runs on network and standard browser
In, specific function application is realized based on web technologies exploitation.The characteristics of webapp is: institute is effective and interaction is at one
It is realized in the html page.Currently, the included advance and retreat key of the browser of terminal device, user is in the single page application using browser
During can carry out various trigger actions and make respective response to trigger browser, which both can be for clear
The operation that the page for the single side application look at is clicked, and the operation of click can be made for key of retreating to browser includedly
Etc..With the extensive use of webapp, the trigger action in webapp how is rapidly and accurately identified, so that browser
Correctly response can be made to promote the intelligence of browser, become a urgent problem to be solved.
Summary of the invention
The embodiment of the present invention provides operation recognition methods, device and the browser of a kind of single page application, can be to browser
Trigger action in single page application is rapidly and accurately identified, the intelligence of browser is promoted.
First aspect present invention provides a kind of operation recognition methods of single page application, it may include:
When there are the references for the webpage configuration parameter for when trigger action, obtaining the browser in the application of the single page of browser
The reference value of value and preset web page variable parameter;
The reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter is compared;
According to the comparison result, the type of the trigger action is determined.
Second aspect of the present invention provides a kind of operation identification device of single page application, it may include:
Obtain module, for when the single page of browser application in there are when trigger action, obtain the webpage of the browser
The reference value of the reference value of configuration parameter and preset web page variable parameter;
Comparison module, for by the reference of the reference value of the webpage configuration parameter and the preset web page variable parameter
Value is compared;
Identification module, for determining the type of the trigger action according to the comparison result.
Third aspect present invention provides a kind of browser, it may include the operation for the single page application that above-mentioned second aspect provides is known
Other device.
The implementation of the embodiments of the present invention has the following beneficial effects:
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of the operation recognition methods of single page application provided in an embodiment of the present invention;
Fig. 2 is the flow chart of the operation recognition methods of another single page application provided in an embodiment of the present invention;
Fig. 3 is the flow chart of the operation recognition methods of another single page provided in an embodiment of the present invention application;
Fig. 4 is a kind of structural schematic diagram of the operation identification device of single page application provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of the operation identification device of another single page application provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of one embodiment provided in an embodiment of the present invention for obtaining module;
Fig. 7 is the structural schematic diagram of another embodiment provided in an embodiment of the present invention for obtaining module.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In the embodiment of the present invention, it is that one kind runs on net that single page, which refers to system and application based on web using (webapp),
In network and standard browser, specific function application is realized based on web technologies exploitation.The characteristics of webapp, is: institute it is effective and
Interaction is in a html(HyperText Markup Language, hypertext markup language) it realizes in the page.
Below in conjunction with attached drawing 1- attached drawing 3, the operation recognition methods of single page provided in an embodiment of the present invention application is carried out
It is discussed in detail.It should be noted that the operation recognition methods of the attached single page application shown in Fig. 3 of attached drawing 1- can be implemented by the present invention
Performed by the operation identification device for the single page application that example provides, the operation identification device of single page application can run on terminal device
Browser in, wherein terminal device may include but be not limited to: PC(Personal Computer, personal computer), PAD(it is flat
Plate computer), mobile phone, smart phone, the equipment such as laptop.
It referring to Figure 1, is a kind of flow chart of the operation recognition methods of single page application provided in an embodiment of the present invention;The party
Method may include following steps S101- step S103.
S101, when there are the webpage configuration parameters for when trigger action, obtaining the browser in the application of the single page of browser
Reference value and preset web page variable parameter reference value.
Wherein, the trigger action in the single page application of browser, may include: the single page application opened for browser
The page in chained address caused by trigger action, or browser open single page application the page when be directed to browser
Key caused by trigger action.
Wherein, the webpage configuration parameter of the browser can be used for indicating the webpage number that the browser recent visit is crossed
Amount.The webpage configuration parameter can be expressed as history.length, and the value of history.length is in browser
The variation of webpage quantity and change.It should be noted that in the page for the single page application either opened for browser
Trigger action caused by chained address, or when browser opens the page of single page application for the advance and retreat key of browser
Generated trigger action, the Web evolution that browser can be caused to be accessed, to influence the reference of history.length
Value.
Wherein, the preset web page variable parameter can be used for reflecting the page for the single page application opened for browser
In chained address caused by trigger action quantity.The preset web page variable parameter can be expressed as X.length,
X.length can be set in memory, also can be set in the address information of the single page application of the browser.It needs
Bright, trigger action caused by the chained address in the page applied for the single page that browser is opened can influence
The reference value of X.length;And it is touched caused by the advance and retreat key when browser opens the page of single page application for browser
Hair operation then will not influence the reference value of X.length.
S102 compares the reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter
Compared with.
This step is mainly the reference value of the webpage configuration parameter and the ginseng of the preset web page variable parameter
The numerical values recited of value is examined, that is, compares the numerical values recited of the reference value of history.length and the reference value of X.length.This step
Suddenly can produce following any comparison result: (1) reference value of history.length is greater than the reference value of X.length;(2)
The reference value of history.length is equal to the reference value of X.length;(3) reference value of history.length is less than
The reference value of X.length.
S103 determines the type of the trigger action according to the comparison result.
In the embodiment of the present invention, the type of trigger action may include: page clicking operation, page back operation or the page
Forward operation.Wherein, page clicking operation belongs to the chained address institute in the page for the single page application opened for browser
The trigger action of generation refers to that user clicks any one chain ground connection in the current page for the single page application that browser is opened
Location makes browser open the operation of another page of single page application.Page back operation, which belongs to, opens single page application in browser
The page when key for browser caused by trigger action, after referring to the current page that browser opens single page application,
User clicks the Reverse keys of browser, and browser is made to open the operation of the previous page of current page.Page forward operation category
Trigger action caused by key when opening the page of single page application in browser for browser, refers to that browser is opened
After the current page of single page application, user clicks the forward key of browser, and browser is made to open the following page of current page
Operation.In this step, the numerical value of the reference value of reference value and X.length based on history.length compares as a result, can
Accurately determine the type of trigger action.Specifically, if step S102, which obtains (1), plants comparison result, this step can determine touching
The type of hair operation is page forward operation;If step S102 obtains (2) and plants comparison result, this step can determine trigger action
Type be page clicking operation;If step S102 obtains (3) and plants comparison result, this step can determine the type of trigger action
For page back operation.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Fig. 2 is referred to, for the flow chart of the operation recognition methods of another single page application provided in an embodiment of the present invention;It should
Method may include following steps S201- step S211.
S201, when in a browser starting single page in application, reading the initial value of the webpage configuration parameter of the browser.
Wherein, the webpage configuration parameter can be expressed as history.length.In this step, start in a browser
Single page application refers to a certain page for being initially opened single page application in a browser, and the value of history.length can be read at this time,
The value of the history.length of the reading can be used as the operation recognition methods of the single page application illustrated applied to the present embodiment
The initial value of history.length in process.
S202, in memory or the single page application address information in preset web page variable parameter, make described preset
Web page variable parameter initial value be equal to the webpage configuration parameter initial value.
Wherein, the preset web page variable parameter can be expressed as X.length.X.length can be set in memory
In, in the specific implementation, X.length can be stored in memory;X.length also can be set the single page in the browser and answer
In address information, in the specific implementation, can be the URL(Uniform Resource Locator of single page application, it is unified to provide
Source finger URL) address addition variable parameter field, X.length is stored in the variable parameter field.In this step, it is being arranged
After X.length, the initial value for the history.length that step S201 is read can be assigned to X.length, to make
The initial value of X.length is equal to the initial value of history.length.
S203 confirms the single page of the browser when listening to the first information in the application of the single page of the browser
There are trigger actions in.
Wherein, the first information refers to that the chained address in the page for the single page application opened for browser is touched
Generated information when hair operation.When this step listens to the first information in the single page application of browser, then it can confirm described
There are trigger actions in the single page application of browser.It is understood that this step also may further confirm that the trigger action category
Trigger action caused by chained address in the page for the single page application opened for browser.
The initial value of the preset web page variable parameter is set as basic value by S204, and by the preset webpage
The basic value of variable parameter increases default value, obtains the reference value of the preset web page variable parameter.
S205 updates the address information of the single page application in the browser, makes the browser by the webpage
The initial value of configuration parameter is set as basic value, and the basic value of the webpage configuration parameter is synchronized and increases the present count
Value, to obtain the reference value of the webpage configuration parameter.
In step S204-S205, default value can be set according to actual needs, such as: default value can be set
It is 1,2, etc..It should be noted that after default value setting, the preset web page variable parameter (i.e. X.length)
When numerical value change occurs with the webpage configuration parameter (i.e. history.length) of the browser, X.length and
History.length increaseds or decreases basic value using the default value as step-length, to obtain reference value.
S206 obtains the reference value of the webpage configuration parameter and the reference value of the preset web page variable parameter.
The step S203- step S206 of the present embodiment can be the specific refinement step of the step S101 of embodiment illustrated in fig. 1
Suddenly.
S207 compares the reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter
Compared with.
This step can be found in the step S102 of embodiment illustrated in fig. 1, and this will not be repeated here.This step is producible following any
Kind comparison result: (1) reference value of history.length is greater than the reference value of X.length;After obtaining if this comparison result
It is continuous to be transferred to step S210;(2) reference value of history.length is equal to the reference value of X.length, if obtaining this compares knot
Fruit is then subsequent to be transferred to step S208;(3) reference value of history.length is less than the reference value of X.length, if obtaining this
Comparison result is then subsequent to be transferred to step S209.
S208, if the reference value of the webpage configuration parameter is equal to the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page clicking operation;Later, it is transferred to step S211.
S209, if the reference value of the webpage configuration parameter is less than the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page back operation;Later, it is transferred to step S211.
S210, if the reference value of the webpage configuration parameter is greater than the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page forward operation;Later, it is transferred to step S211.
In step S208-S210, since is produced from the chained address in the page for the single page application opened for browser
The reference value of raw trigger action meeting synchronous impact history.length and the reference value of X.length, therefore, step S208
In, if the reference value of history.length is equal to the reference value of X.length, determine that the trigger action belongs to for browsing
Trigger action caused by chained address in the page for the single page application that device is opened, so that it is determined that the class of the trigger action
Type is page clicking operation.It is triggered as caused by the key in the page of browser opening single page application for browser
Operation will affect the reference value of history.length, but not influence the reference value of X.length, therefore, step S209-
In S210, if the reference value of history.length is not equal to the reference value of X.length, determine that the trigger action belongs to
Trigger action caused by key when browser opens the page of single page application for browser.Further, in step S209,
If the reference value of history.length is less than the reference value of X.length, show that the trigger action makes
The basic value of history.length generates reduced variation to obtain the reference value of history.length, to can determine institute
The type of trigger action is stated as page back operation.In step S210, if the reference value of history.length is greater than
The reference value of X.length shows that the trigger action makes the basic value of history.length generate increased variation to obtain
The reference value of X.length is obtained, to can determine that the type of the trigger action is page forward operation.
The step S208- step S210 of the present embodiment can be the specific refinement step of the step S103 of embodiment illustrated in fig. 1
Suddenly.
S211 updates the basic value of the webpage configuration parameter using the reference value of the webpage configuration parameter;And it adopts
The basic value of the preset web page variable parameter is updated with the reference value of the preset web page variable parameter.
After step S208-S210 has determined the type of trigger action, this step uses the ginseng of history.length
The basic value that value updates history.length is examined, and updates the basic value of X.length using the reference value of X.length,
So that the reference value of history.length becomes the new basic value of history.length, and make the reference of X.length
Value becomes the new basic value of X.length, to be applied to the trigger action occurred again in the single page application to the browser
Carry out operation identification.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Fig. 3 is referred to, for the flow chart of the operation recognition methods of another single page provided in an embodiment of the present invention application;It should
Method may include following steps S301- step S310.
S301, when in a browser starting single page in application, reading the initial value of the webpage configuration parameter of the browser.
S302, in memory or the single page application address information in preset web page variable parameter, make described preset
Web page variable parameter initial value be equal to the webpage configuration parameter initial value.
The step S301- step S302 of the present embodiment can be found in the step S201- step S202 of embodiment illustrated in fig. 2,
This is not repeated.Wherein, the webpage configuration parameter can be expressed as history.length;The preset web page variable parameter
It can be expressed as X.length.
S303 confirms and deposits in the single page application of the browser when receiving the second information that the browser is sent
In trigger action.
Wherein, second information refer to browser open single page application the page when for browser advance and retreat key into
When row trigger action, information transmitted by browser.This step can then confirm the browser when receiving the second information
There are trigger actions in single page application.It is being browsed it is understood that this step also may further confirm that the trigger action belongs to
Trigger action caused by advance and retreat key when device opens the page of single page application for browser.
The initial value of the preset web page variable parameter is set as basic value by S304, and by the preset webpage
The basic value of variable parameter is determined as the reference value of the preset web page variable parameter.
S305 obtains the reference value of the webpage configuration parameter and the reference value of the preset web page variable parameter,
In, the reference value of the webpage configuration parameter is based on the browser sets the initial value of the webpage configuration parameter
Value, and the basic value of the webpage configuration parameter is increased or decreased by the default value according to the trigger action and is obtained.
It should be noted that if the trigger action is when browser opens the page of single page application for browser
Trigger action caused by Reverse keys, then the initial value of history.length is set as basic value by browser, and should
Basic value reduces the reference value that the default value obtains history.length;If the trigger action is to open in browser
Trigger action caused by forward key for browser when the page of single page application, then browser is by history.length
Initial value be set as basic value, and the basic value is increased into the reference value that the default value obtains history.length.
The step S303- step S305 of the present embodiment can be the specific refinement step of the step S101 of embodiment illustrated in fig. 1
Suddenly.
S306 compares the reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter
Compared with.
S307, if the reference value of the webpage configuration parameter is equal to the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page clicking operation.
S308, if the reference value of the webpage configuration parameter is less than the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page back operation.
S309, if the reference value of the webpage configuration parameter is greater than the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page forward operation.
S310 updates the basic value of the webpage configuration parameter using the reference value of the webpage configuration parameter;And it adopts
The basic value of the preset web page variable parameter is updated with the reference value of the preset web page variable parameter.
The step S306- step S310 of the present embodiment may refer to the step S207- step S211 of embodiment illustrated in fig. 2,
This will not be repeated here.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Below in conjunction with attached drawing 4- attached drawing 7, the operation identification device of single page provided in an embodiment of the present invention application is carried out
It is discussed in detail.It should be noted that the operation identification device of the attached single page application shown in Fig. 7 of attached drawing 4- can run on terminal device
Browser in, for executing the operation recognition methods of the attached single page shown in Fig. 3 application of attached drawing 1-.Wherein terminal device may include
But it is not limited to: the equipment such as PC, PAD, mobile phone, smart phone, laptop.
Fig. 4 is referred to, for a kind of structural schematic diagram of the operation identification device of single page application provided in an embodiment of the present invention;
The device can include: obtain module 101, comparison module 102 and identification module 103.
Obtain module 101, for when the single page of browser application in there are when trigger action, obtain the net of the browser
The page reference value of configuration parameter and the reference value of preset web page variable parameter.
Wherein, the trigger action in the single page application of browser, may include: the single page application opened for browser
The page in chained address caused by trigger action, or browser open single page application the page when be directed to browser
Key caused by trigger action.
Wherein, the webpage configuration parameter of the browser can be used for indicating the webpage number that the browser recent visit is crossed
Amount.The webpage configuration parameter can be expressed as history.length, and the value of history.length is in browser
The variation of webpage quantity and change.It should be noted that in the page for the single page application either opened for browser
Trigger action caused by chained address, or when browser opens the page of single page application for the advance and retreat key of browser
Generated trigger action, the Web evolution that browser can be caused to be accessed, to influence the reference of history.length
Value.
Wherein, the preset web page variable parameter can be used for reflecting the page for the single page application opened for browser
In chained address caused by trigger action quantity.The preset web page variable parameter can be expressed as X.length,
X.length can be set in memory, also can be set in the address information of the single page application of the browser.It needs
Bright, trigger action caused by the chained address in the page applied for the single page that browser is opened can influence
The reference value of X.length;And it is touched caused by the advance and retreat key when browser opens the page of single page application for browser
Hair operation then will not influence the reference value of X.length.
Comparison module 102, for by the reference value of the webpage configuration parameter and the preset web page variable parameter
Reference value is compared.
The comparison module 102 mainly reference value of the webpage configuration parameter and the preset web page variable
The numerical values recited of the reference value of parameter, that is, the numerical value for comparing the reference value of history.length and the reference value of X.length are big
It is small.The comparison module 102 can get following any comparison result: (1) reference value of history.length is greater than
The reference value of X.length;(2) reference value of history.length is equal to the reference value of X.length;(3)
The reference value of history.length is less than the reference value of X.length.
Identification module 103, for determining the type of the trigger action according to the comparison result.
In the embodiment of the present invention, the type of trigger action may include: page clicking operation, page back operation or the page
Forward operation.Wherein, page clicking operation belongs to the chained address institute in the page for the single page application opened for browser
The trigger action of generation refers to that user clicks any one chain ground connection in the current page for the single page application that browser is opened
Location makes browser open the operation of another page of single page application.Page back operation, which belongs to, opens single page application in browser
The page when key for browser caused by trigger action, after referring to the current page that browser opens single page application,
User clicks the Reverse keys of browser, and browser is made to open the operation of the previous page of current page.Page forward operation category
Trigger action caused by key when opening the page of single page application in browser for browser, refers to that browser is opened
After the current page of single page application, user clicks the forward key of browser, and browser is made to open the following page of current page
Operation.The numerical value of the reference value of reference value and X.length of the identification module 103 based on history.length compares
As a result, the type of trigger action can be accurately determined.Specifically, if the comparison module 102, which obtains (1), plants comparison result,
The identification module 103 can determine that the type of trigger action is page forward operation;If the comparison module 102 obtains (2)
Kind comparison result, the identification module 103 can determine that the type of trigger action is page clicking operation;If the comparison module
102, which obtain (3), plants comparison result, and the identification module 103 can determine the type of trigger action for page back operation.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Fig. 5 is referred to, for the structural representation of the operation identification device of another single page application provided in an embodiment of the present invention
Figure;The device can include: obtain module 101, comparison module 102, identification module 103, initialization module 104 and update module
105.Wherein, obtaining module 101, comparison module 102 can be found in the related of embodiment illustrated in fig. 4 to the structure of identification module 103
Description, this will not be repeated here.
Initialization module 104, for single page ought to be started in a browser in application, reading the webpage configuration of the browser
The initial value of parameter, in memory or the single page application address information in preset web page variable parameter, make described preset
Web page variable parameter initial value be equal to the webpage configuration parameter initial value.
Wherein, the webpage configuration parameter can be expressed as history.length;The preset web page variable parameter
It can be expressed as X.length.Starting single page application in a browser refers to certain one page for being initially opened single page application in a browser
The value of history.length can be read in face, the initialization module 104, and the value of the history.length of the reading can be used as
The initial value for operating the history.length in recognition methods process applied to the single page application that the present embodiment is illustrated.Its
In, X.length can be set in memory, in the specific implementation, X.length can be stored in memory;X.length can also
To be set in the address information of single page application of the browser, in the specific implementation, can add for the address URL of single page application
Addition of variable parameter field stores X.length in the variable parameter field.After X.length is set, the initialization module
104 can assign the initial value of the history.length read to X.length, so that the initial value of X.length be made to be equal to
The initial value of history.length.
Update module 105 updates the base of the webpage configuration parameter for the reference value using the webpage configuration parameter
Plinth value;And the basis of the preset web page variable parameter is updated using the reference value of the preset web page variable parameter
Value.
The update module 105 updates the basic value of history.length using the reference value of history.length,
And the basic value of X.length is updated using the reference value of X.length, so that the reference value of history.length becomes
The new basic value of history.length, and make the reference value of X.length as the new basic value of X.length, with
Operation identification is carried out applied to the trigger action occurred again in the single page application to the browser.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Below in conjunction with attached drawing 6- attached drawing 7, each of identification device is operated to single page provided in an embodiment of the present invention application
The structure and function of module describes in detail.
Fig. 6 is referred to, for the structural schematic diagram of one embodiment provided in an embodiment of the present invention for obtaining module;The acquisition
Module 101 can include: the first confirmation unit 1101, the first parameter processing unit 1102, synchronous processing unit 1103 and first obtain
Take unit 1104.
First confirmation unit 1101, for confirming when listening to the first information in the application of the single page of the browser
There are trigger actions in the single page application of the browser.
Wherein, the first information refers to that the chained address in the page for the single page application opened for browser is touched
Generated information when hair operation.First confirmation unit 1101 listens to the first information in the single page application of browser
When, then it can confirm that there are trigger actions in the single page application of the browser.It is understood that first confirmation unit
1101 also may further confirm that the chained address that the trigger action belongs in the page for the single page application opened for browser
Generated trigger action.
First parameter processing unit 1102, for the initial value of the preset web page variable parameter to be increased present count
Value obtains the reference value of the preset web page variable parameter.
Synchronous processing unit 1103 makes described for updating the address information of the single page application in the browser
The initial value of the webpage configuration parameter is set as basic value by browser, and the basic value of the webpage configuration parameter is synchronous
Increase the default value, to obtain the reference value of the webpage configuration parameter.
Wherein, default value can be set according to actual needs, such as: default value may be set to 1,2, etc..
It should be noted that after default value setting, preset the web page variable parameter (i.e. X.length) and the browsing
When numerical value change occurs for the webpage configuration parameter (i.e. history.length) of device,
X.length and history.length increaseds or decreases basic value using the default value as step-length, with
Obtain reference value.
First acquisition unit 1104, for obtain the webpage configuration parameter reference value and the preset web page variable
The reference value of parameter.
It should be noted that the identification module 103 is specifically used for the ginseng in the webpage configuration parameter in the present embodiment
When examining reference value of the value equal to the preset web page variable parameter, determine that the type of the trigger action is that the page clicks behaviour
Make;Alternatively, for when the reference value of the webpage configuration parameter is less than the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page back operation;Alternatively, the reference value in the webpage configuration parameter is greater than institute
The reference value for stating preset web page variable parameter determines that the type of the trigger action is page forward operation.
Since trigger action caused by the chained address in the page for the single page application opened for browser can be same
Step influences the reference value of history.length and the reference value of X.length, therefore, if the reference value of history.length
Reference value equal to X.length, the identification module 103 determine that the trigger action belongs to the list opened for browser
Trigger action caused by chained address in the page of page application, so that it is determined that the type of the trigger action is page click
Operation.The trigger action as caused by the key in the page of browser opening single page application for browser will affect
The reference value of history.length, but not the reference value of X.length is influenced, therefore, if the reference of history.length
Value is not equal to the reference value of X.length, and the identification module 103 determines that the trigger action belongs to and opens single page in browser
Trigger action caused by key when the page of application for browser.Further, if the reference value of history.length
Reference value less than X.length shows that the trigger action makes the basic value of history.length generate reduced variation
To obtain the reference value of history.length, the identification module 103 can determine the type of the trigger action for after the page
Move back operation.If the reference value of history.length is greater than the reference value of X.length, show that the trigger action makes
The basic value of history.length generates increased variation to obtain the reference value of X.length, and the identification module 103 can
The type for determining the trigger action is page forward operation.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
Fig. 7 is referred to, for the structural schematic diagram of another embodiment provided in an embodiment of the present invention for obtaining module;This is obtained
Modulus block 101 can include: the second confirmation unit 1111, the second parameter processing unit 1112 and second acquisition unit 1113.
Second confirmation unit 1111, for confirming the browsing when receiving the second information that the browser is sent
There are trigger actions in the single page application of device.
Wherein, second information refer to browser open single page application the page when for browser advance and retreat key into
When row trigger action, information transmitted by browser.Second confirmation unit 1111, then can be true when receiving the second information
Recognize the browser single page application in there are trigger actions.It is understood that second confirmation unit 1111 can also be into
One step confirms that the trigger action belongs to produced by the advance and retreat key when browser opens the page of single page application for browser
Trigger action.
Second parameter processing unit 1112, based on setting the initial value of the preset web page variable parameter
It is worth, and the basic value of the preset web page variable parameter is determined as to the reference value of the preset web page variable parameter.
Second acquisition unit 1113, for obtain the webpage configuration parameter reference value and the preset web page variable
The reference value of parameter, wherein the reference value of the webpage configuration parameter is that the browser will be at the beginning of the webpage configuration parameter
Initial value is set as basic value, and according to the trigger action is increased or decreased the basic value of the webpage configuration parameter described pre-
If numerical value obtains.
It should be noted that if the trigger action is when browser opens the page of single page application for browser
Trigger action caused by Reverse keys, then the initial value of history.length is set as basic value by browser, and should
Basic value reduces the reference value that the default value obtains history.length;If the trigger action is to open in browser
Trigger action caused by forward key for browser when the page of single page application, then browser is by history.length
Initial value be set as basic value, and the basic value is increased into the reference value that the default value obtains history.length.
It should be noted that the identification module 103 is specifically used for the ginseng in the webpage configuration parameter in the present embodiment
When examining reference value of the value equal to the preset web page variable parameter, determine that the type of the trigger action is that the page clicks behaviour
Make;Alternatively, for when the reference value of the webpage configuration parameter is less than the reference value of the preset web page variable parameter, really
The type of the fixed trigger action is page back operation;Alternatively, the reference value in the webpage configuration parameter is greater than institute
The reference value for stating preset web page variable parameter determines that the type of the trigger action is page forward operation.
Since trigger action caused by the chained address in the page for the single page application opened for browser can be same
Step influences the reference value of history.length and the reference value of X.length, therefore, if the reference value of history.length
Reference value equal to X.length, the identification module 103 determine that the trigger action belongs to the list opened for browser
Trigger action caused by chained address in the page of page application, so that it is determined that the type of the trigger action is page click
Operation.The trigger action as caused by the key in the page of browser opening single page application for browser will affect
The reference value of history.length, but not the reference value of X.length is influenced, therefore, if the reference of history.length
Value is not equal to the reference value of X.length, and the identification module 103 determines that the trigger action belongs to and opens single page in browser
Trigger action caused by key when the page of application for browser.Further, if the reference value of history.length
Reference value less than X.length shows that the trigger action makes the basic value of history.length generate reduced variation
To obtain the reference value of history.length, the identification module 103 can determine the type of the trigger action for after the page
Move back operation.If the reference value of history.length is greater than the reference value of X.length, show that the trigger action makes
The basic value of history.length generates increased variation to obtain the reference value of X.length, and the identification module 103 can
The type for determining the trigger action is page forward operation.
It, can be according to the reference value and preset web page variable parameter of the webpage configuration parameter of browser in the embodiment of the present invention
Reference value numerical value compare as a result, determine browser single page application in trigger action type;Operate identification process letter
It is single easy, and the recognition result for quickly, efficiently and accurately obtaining trigger action is obtained, so that browser being capable of rapid pin pair
Trigger action makes correct response, improves the intelligence of browser.
The embodiment of the invention also discloses a kind of browser, which may include the operation identification device of single page application,
The operation identification device of single side application can be found in Fig. 4-embodiment illustrated in fig. 7 associated description, and this will not be repeated here.It needs to illustrate
, the browser of the present embodiment can be applied in Fig. 1-method shown in Fig. 3.
Description through the foregoing embodiment can be according to the reference of the webpage configuration parameter of browser in the embodiment of the present invention
The numerical value of the reference value of value and preset web page variable parameter compares as a result, determining the trigger action in the single page application of browser
Type;Operation identification process is simple and easy, and obtains the recognition result for quickly, efficiently and accurately obtaining trigger action, to make
Browser can rapid pin correct response is made to trigger action, improve the intelligence of browser.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.
Claims (9)
1. a kind of operation recognition methods of single page application characterized by comprising
When listening to the first information in the application of the single page of browser, confirm in the single page application of the browser there is triggering
Operation;The initial value of preset web page variable parameter is set as basic value, and by the base of the preset web page variable parameter
Plinth value increases default value, obtains the reference value of the preset web page variable parameter;The list is updated in the browser
The address information of page application, makes the browser that the initial value of webpage configuration parameter is set as basic value, and by the webpage
The basic value of configuration parameter is synchronous to increase the default value, to obtain the reference value of the webpage configuration parameter;Described in acquisition
The reference value of the reference value of webpage configuration parameter and the preset web page variable parameter;Alternatively,
When receiving the second information that the browser is sent, confirm in the single page application of the browser there is triggering behaviour
Make;The initial value of the preset web page variable parameter is set as basic value, and by the preset web page variable parameter
Basic value is determined as the reference value of the preset web page variable parameter;Obtain the reference value of the webpage configuration parameter and described
The reference value of preset web page variable parameter, wherein the reference value of the webpage configuration parameter is the browser by the net
The initial value of page configuration parameter is set as basic value, and is increased the basic value of the webpage configuration parameter according to the trigger action
The default value that adds deduct less obtains;
The reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter is compared;
According to the comparison result, the type of the trigger action is determined.
2. the method as described in claim 1, which is characterized in that described when there are trigger actions in the single page application of browser
When, before obtaining the reference value of the webpage configuration parameter of the browser and the reference value of preset web page variable parameter, also wrap
It includes:
When in a browser starting single page in application, reading the initial value of the webpage configuration parameter of the browser;
In memory or the single page application address information in preset web page variable parameter, make the preset web page variable
The initial value of parameter is equal to the initial value of the webpage configuration parameter.
3. the method as described in claim 1, which is characterized in that it is described according to the comparison result, determine the trigger action
Type, comprising:
If the reference value of the webpage configuration parameter is equal to the reference value of the preset web page variable parameter, the triggering is determined
The type of operation is page clicking operation;
If the reference value of the webpage configuration parameter is less than the reference value of the preset web page variable parameter, the triggering is determined
The type of operation is page back operation;
If the reference value of the webpage configuration parameter is greater than the reference value of the preset web page variable parameter, the triggering is determined
The type of operation is page forward operation.
4. the method as described in claim 1, which is characterized in that it is described according to the comparison result, determine the trigger action
Type after, further includes:
The basic value of the webpage configuration parameter is updated using the reference value of the webpage configuration parameter;And
The basic value of the preset web page variable parameter is updated using the reference value of the preset web page variable parameter.
5. a kind of operation identification device of single page application characterized by comprising
Module is obtained, for when there are the webpage configurations for when trigger action, obtaining the browser in the application of the single page of browser
The reference value of the reference value of parameter and preset web page variable parameter;
Comparison module, for by the reference value of the reference value of the webpage configuration parameter and the preset web page variable parameter into
Row compares;
Identification module, for determining the type of the trigger action according to the comparison result;
Wherein, the acquisition module includes:
First confirmation unit, for confirming the browsing when listening to the first information in the application of the single page of the browser
There are trigger actions in the single page application of device;
First parameter processing unit obtains institute for the initial value of the preset web page variable parameter to be increased default value
State the reference value of preset web page variable parameter;
Synchronous processing unit makes the browser will for updating the address information of the single page application in the browser
The initial value of the webpage configuration parameter is set as basic value, and will be described in the synchronous increase of the basic value of the webpage configuration parameter
Default value, to obtain the reference value of the webpage configuration parameter;
First acquisition unit, for obtaining the reference value of the webpage configuration parameter and the ginseng of the preset web page variable parameter
Examine value;
Alternatively, the acquisition module includes:
Second confirmation unit, for confirming the single page of the browser when receiving the second information that the browser is sent
There are trigger actions in;
Second parameter processing unit, for the initial value of the preset web page variable parameter to be set as basic value, and by institute
The basic value for stating preset web page variable parameter is determined as the reference value of the preset web page variable parameter;
Second acquisition unit, for obtaining the reference value of the webpage configuration parameter and the ginseng of the preset web page variable parameter
Examine value, wherein the reference value of the webpage configuration parameter is that the browser sets the initial value of the webpage configuration parameter
Based on be worth, and the basic value of the webpage configuration parameter is increased or decreased by the default value according to the trigger action and is obtained
?.
6. device as claimed in claim 5, which is characterized in that further include:
Initialization module, for single page ought to be started in a browser in application, reading the webpage configuration parameter of the browser
Initial value, in memory or the single page application address information in preset web page variable parameter, make the preset webpage
The initial value of variable parameter is equal to the initial value of the webpage configuration parameter.
7. device as claimed in claim 5, which is characterized in that the identification module is specifically used in the webpage configuration parameter
Reference value be equal to the preset web page variable parameter reference value when, determine the type of the trigger action be the page click
Operation;Alternatively,
When being less than the reference value of the preset web page variable parameter for the reference value in the webpage configuration parameter, institute is determined
The type of trigger action is stated as page back operation;Alternatively,
For the reference value in the webpage configuration parameter be greater than the preset web page variable parameter reference value, determine described in
The type of trigger action is page forward operation.
8. device as claimed in claim 5, which is characterized in that further include:
Update module updates the basic value of the webpage configuration parameter for the reference value using the webpage configuration parameter;With
And the basic value of the preset web page variable parameter is updated using the reference value of the preset web page variable parameter.
9. a kind of browser, which is characterized in that the operation including the described in any item single page applications of such as claim 5-8 identifies dress
It sets.
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 CN104679501A (en) | 2015-06-03 |
CN104679501B true 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 |
---|---|
CN104679501A (en) | 2015-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11108807B2 (en) | Performing rule-based actions for newly observed domain names | |
CN103984686B (en) | page switching method and device | |
WO2018133452A1 (en) | Webpage rendering method and related device | |
CN101122921B (en) | Method forming tree-shaped display structure based on ajax and html | |
CN105959371B (en) | Webpage share system | |
CN106649543A (en) | Reading progress recording method and device and terminal | |
CN105095374A (en) | Method and device for browsing mobile terminal news | |
CN102298617A (en) | Method for obtaining target page and equipment | |
CN106326342B (en) | Report method and device, the electronic equipment of page data on flows | |
CN112565406A (en) | Gray scale publishing method, gray scale publishing system and electronic equipment | |
CN104731817B (en) | A kind of webpage exhibiting method and device | |
CN108319474A (en) | A kind of page info generation method, device and equipment | |
CN104679501B (en) | A kind of operation recognition methods, device and the browser of single page application | |
KR101184809B1 (en) | Method and server for providing web page | |
US10775966B2 (en) | Customizable autocomplete option | |
CN104965926B (en) | Webpage providing method and device | |
CN107133246A (en) | Browser window partition method and system | |
CN103577438B (en) | A kind of method, apparatus and system for sending field feedback | |
CN109325190A (en) | A kind of method and relevant apparatus of page management | |
CN110020268A (en) | Page returning method and device | |
US11327632B2 (en) | Methods, apparatuses, browsers, and electronic devices for providing website navigation icons | |
CN110740074B (en) | Network address detection method and device and electronic equipment | |
CN110147478A (en) | Web page subject word acquisition methods and system, server and user terminal | |
KR20120085217A (en) | Method and server for providing web page | |
CN104601614B (en) | The method for down loading and device of client |
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 |