A kind of filter method and device for internet site front end logic entrance
Technical field
The present invention relates to a kind of internet barrages, and field is broadcast live, and especially relates to one kind and enters for internet site front end logic
The filter method and device of mouth.
Background technique
In front end development field, most of websites are directed to some functions (such as: logging in), complete in script edit
After core function logic, need all logic entrance binding event, complicated scene even can be one time by logical overwrite,
Guarantee the normal of overall logic.This mode greatly increases the redundancy and maintenance cost of code.
Summary of the invention
The present invention mainly solves technical problem present in the prior art;It provides one kind and is directed to some function of website
Can, after completing core function logic in script edit, does not need all logic entrances binding event, greatly reduce
The redundancy of code and a kind of filter method and device for internet site front end logic entrance of maintenance cost.
Above-mentioned technical problem of the invention is mainly to be addressed by following technical proposals:
A kind of filter method for internet site front end logic entrance characterized by comprising
Step 1, interception movement is pre-configured with by client, the trigger condition of interception movement is when user triggers the page
It is triggered when the function of element;Then on client real-time monitoring internet site page elements click event, when user trigger
When a certain function of page elements, starting interception acts and intercepts the trigger action;
Step 2, the corresponding identity type of a certain function for the page elements that client is triggered according to user is analyzed, and
Analysis result is sent to server, server calls execution function event corresponding with the identity type based on the analysis results;
Step 3, the execution function event that client executing step 2 is called, and inform user.
Preferably, the function of the page elements, identity type corresponding with the function of page elements are customized, mark
Type is stored in identity type library.
Preferably, described to execute the execution function event that function event is internet site storage, the execution function thing
Part is corresponding with identity type, and corresponding relationship is customized.
Preferably, it in the step 2, is carried out according to the corresponding identity type of a certain function of the page elements of user's triggering
The specific method of analysis is: whether there is identity type corresponding with the function of page elements in Search Flags typelib, if depositing
It is sending and is executing recalls information to server.
A kind of filter device for internet site front end logic entrance, comprising:
Event interception module: interception movement is pre-configured with by client, the trigger condition of interception movement is to work as user
It is triggered when triggering the function of page elements;Then on client real-time monitoring internet site page elements click event, when
When user triggers a certain function of page elements, starting interception acts and intercepts the trigger action;
Event analysis calling module: the corresponding identity type of a certain function for the page elements that client is triggered according to user
It is analyzed, and server is sent to for result is analyzed by event analysis calling module, server passes through based on the analysis results
Event analysis calling module calls execution function event corresponding with the identity type;
Execution module: client executes the execution function event that event analysis calling module calls by execution module, and
Inform user.
Preferably, the function of the page elements, identity type corresponding with the function of page elements are customized, mark
Type is stored in identity type library.
Preferably, described to execute the execution function event that function event is internet site storage, the execution function thing
Part is corresponding with identity type, and corresponding relationship is customized.
Preferably, what the corresponding identity type of a certain function for the page elements that client is triggered according to user was analyzed
Specific method is: whether there is identity type corresponding with the function of page elements in Search Flags typelib, and if it exists, sends
Recalls information is executed to server.
Therefore, the present invention has the advantage that being directed to some function of website, core function is completed in script edit
After logic, do not need all logic entrances binding event, in the redundancy and maintenance cost that greatly reduced code.
Detailed description of the invention
Fig. 1 is the method flow schematic diagram of invention.
Fig. 2 is the flow diagram of case 1 in the embodiment of the present invention 1.
Fig. 3 is the flow diagram of case 2 in the embodiment of the present invention 1.
Fig. 4 is structural block diagram of the invention.
Specific embodiment
Below with reference to the embodiments and with reference to the accompanying drawing the technical solutions of the present invention will be further described.
A kind of filter method for internet site front end logic entrance, comprising:
Step 1, interception movement is pre-configured with by client, the trigger condition of interception movement is when user triggers the page
It is triggered when the function of element;Then on client real-time monitoring internet site page elements click event, when user trigger
When a certain function of page elements, starting interception acts and intercepts the trigger action;Wherein, the function and the page of page elements
The corresponding identity type of the function of element be it is customized, identity type is stored in identity type library.
Step 2, the corresponding identity type of a certain function for the page elements that client is triggered according to user is analyzed, and
Analysis result is sent to server, server calls execution function event corresponding with the identity type based on the analysis results;
The execution function event that function event is internet site storage is executed, the execution function event is corresponding with identity type, right
It should be related to be customized.Specific method is: whether there is mark corresponding with the function of page elements in Search Flags typelib
Type, and if it exists, send and execute recalls information to server.
Step 3, the execution function event that client executing step 2 is called, and inform user.
A kind of filter device for internet site front end logic entrance, comprising:
Event interception module: interception movement is pre-configured with by client, the trigger condition of interception movement is to work as user
It is triggered when triggering the function of page elements;Then on client real-time monitoring internet site page elements click event, when
When user triggers a certain function of page elements, starting interception acts and intercepts the trigger action;Wherein, the function of page elements
Can, identity type corresponding with the function of page elements be it is customized, identity type is stored in identity type library.
Event analysis calling module: the corresponding identity type of a certain function for the page elements that client is triggered according to user
It is analyzed, and server is sent to for result is analyzed by event analysis calling module, server passes through based on the analysis results
Event analysis calling module calls execution function event corresponding with the identity type;Function event is executed to deposit for internet site
The execution function event of storage, the execution function event is corresponding with identity type, and corresponding relationship is customized.Specific method is:
It whether there is identity type corresponding with the function of page elements in Search Flags typelib, and if it exists, send to execute and call letter
It ceases to server.
Execution module: client executes the execution function event that event analysis calling module calls by execution module, and
Inform user.
Embodiment 1:
The present invention provides a kind of filter method for internet site front end logic entrance, comprising:
Step 1, interception movement is pre-configured with by client, the trigger condition of interception movement is when user triggers the page
It is triggered when the function of element;Then on client real-time monitoring internet site page elements click event, when user trigger
When a certain function of page elements, starting interception acts and intercepts the trigger action;Wherein, the function and the page of page elements
The corresponding identity type of the function of element be it is customized, identity type is stored in identity type library.
Step 2, the corresponding identity type of a certain function for the page elements that client is triggered according to user is analyzed, and
Analysis result is sent to server, server calls execution function event corresponding with the identity type based on the analysis results;
The execution function event that function event is internet site storage is executed, the execution function event is corresponding with identity type, right
It should be related to be customized.Specific method is: whether there is mark corresponding with the function of page elements in Search Flags typelib
Type, and if it exists, send and execute recalls information to server.
Step 3, the execution function event that client executing step 2 is called, and inform user.
Case 1
It is as shown in Figure 2:
Step 1, the page initializes, and client monitors all page elements comprising filtration types.Step 2, page elements
" individual center " in initialization, design filtration types are " login ",
It represents before this function enters and needs to verify login.
Step 3, when the user clicks " individual center ", directly intercepted by client, and intercept information is sent to server,
If user is not logged in, server pop-up login frame simultaneously guides user to log in, and individual center is entered after logining successfully;If user
It has been logged in that, server guidance user is directly entered individual center.
Case 2
It is as shown in Figure 3:
Step 1, client passes through the extension of external business logic, monitors the click event of all hyperlink.
Step 2, when the hyperlink (web sites function) that a chained address is "/join " is clicked by user, client can be certainly
Dynamic to intercept, if subscriber data is not perfect, server pop-up data fills in frame and guides user's perfect information;If data is
Through perfect, server then guides user to be directly entered the registration page.
Embodiment 2
The present invention provides a kind of filter device for internet site front end logic entrance, in the embodiment 1
Filter method for internet site front end logic entrance corresponds, and is not repeating herein.
Specific embodiment described herein is only an example for the spirit of the invention.The neck of technology belonging to the present invention
The technical staff in domain can make various modifications or additions to the described embodiments or replace by a similar method
In generation, however, it does not deviate from the spirit of the invention or beyond the scope of the appended claims.