CN104049956B - A kind of input state emigration processing method and system - Google Patents
A kind of input state emigration processing method and system Download PDFInfo
- Publication number
- CN104049956B CN104049956B CN201310078543.0A CN201310078543A CN104049956B CN 104049956 B CN104049956 B CN 104049956B CN 201310078543 A CN201310078543 A CN 201310078543A CN 104049956 B CN104049956 B CN 104049956B
- Authority
- CN
- China
- Prior art keywords
- input frame
- attribute
- input
- text
- focus
- 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)
Abstract
The present invention provides a kind of input state emigration processing methods, comprising: after the completion of page initialization, traverses to page node, obtains the input frame with input state migration attribute;Input frame with input state migration attribute is uniformly processed;The processing are as follows: the attribute value of the input state migration attribute of input frame in reading hypertext markup language html text is filled into input frame for the attribute value as default prompt text, and input frame and focus acquisition event and focus are lost event binding;The present invention also provides a kind of input state migration process systems.The technical solution provided according to the present invention can be improved the treatment effeciency of the input state of input frame.
Description
[technical field]
The present invention relates to internet application field more particularly to a kind of input state emigration processing method and systems.
[background technique]
Currently, user needs to pass through in the usage scenario of the various lists such as registration microblogging, registration mailbox, trade company center
The list that browser is shown submits various information to corresponding server, and list is by one or more input frames or input control group
At;Wherein, the information of batch needs to allow user to input in the form of input frame.Before user does not input information, need
Default prompt official documents and correspondence is shown in input frame, for example, the default prompt official documents and correspondence of user name input frame is that " please input your user
The default prompt official documents and correspondence of name ", address input box is " address that please input you ";When the user clicks input frame and start input information
When, judge whether the information in input frame is default prompt official documents and correspondence, if it is, the information in input frame is emptied, if it is not,
Then keep the Information invariability in input frame;When user, which does not input information, to be left, default prompt official documents and correspondence should be shown in defeated again
Enter in frame;When leaving after user has input information, input frame should retain the information of user's input.And information in input frame
Text style also with input state transformation and convert, default prompt official documents and correspondence text style and user input information text
Printed words formula should distinctly display, for example, text color needs are shown as ash when the information of input frame is default prompt official documents and correspondence
Color, after user inputs information in input frame, the text color of the information of user's input is shown as black, mixed to prevent user
Confuse.
It to the processing method of input state migration is individually detected to the input state of each input frame at present, root
Different processing modes is taken according to the different input states detected, and text is needed using different under different input states
Pattern;For example, individually input frame object is configured that in detection mode
<input type=”text”id=”userName”/>
JavaScript code in logical process program are as follows:
If (current input value of the input frame of userName==" your user name please be input ")
The current input value of the input frame of userName is set to null value;
}
When there are a large amount of input frames, existing independent detection mode is utilized, it is necessary to develop for each input frame
A set of above-mentioned logical process program, it is lower so as to cause development efficiency, more manpower and material resources are expended, development cost is higher;And
And the size of code of logical process program is larger, causes the detection of input state and treatment effeciency lower;In addition, each input frame
Variable is all fixed in the logical process program, is not easy to that the variable of input frame is modified and extended.
[summary of the invention]
The present invention provides a kind of input state emigration processing method and systems, can be improved the input state of input frame
Treatment effeciency.
The specific technical solution of the present invention is as follows:
According to one preferred embodiment of the present invention, a kind of input state emigration processing method, comprising:
After the completion of page initialization, page node is traversed, obtains the input frame with input state migration attribute;
Input frame with input state migration attribute is uniformly processed;The processing are as follows: read hypertext markup
The attribute value of the input state migration attribute of input frame, is filled out the attribute value as default prompt text in language html text
It is charged to input frame, and input frame and focus acquisition event and focus are lost into event binding.
In the above method, the input state migration attribute is added to html text in advance, as the html text
The attribute of middle input frame.
In the above method, the input state migration attribute includes the default display text attribute and input frame of input frame
Default display text Style Attributes.
In the above method, the attribute value of the default display text attribute of the input frame is that the default of input frame shows text
This;
The attribute value of the default display text Style Attributes of the input frame indicates the font sample of the default display text
Formula.
In the above method, the method with the input frame of input state migration attribute is obtained are as follows:
According to the attribute-name of preset input state migration attribute, obtaining from html text has input state to migrate attribute
Input frame, and will acquire with input state migration attribute input frame be saved in array.
In the above method, the attribute value of the input state migration attribute for reading input frame in html text will be described
Attribute value is filled into input frame as default prompt text specifically:
The input state migration attribute of corresponding input frame is obtained in html text according to input frame ID;
The attribute value that display text attribute is defaulted in input state migration attribute is read, using the attribute value as the input
The default display text of frame is filled into the input frame;
The attribute value for reading the default display text Style Attributes of input frame in input state migration attribute, according to the category
Property be worth the font style that display text is defaulted in corresponding Cascading Style Sheet CSS style setting input frame.
It is described that input frame and focus acquisition event and focus are lost into event binding in the above method specifically:
Input frame object is obtained according to input frame ID, focus is added for the input frame object and obtains event functions and focus
Lose event functions;It includes the movement and triggering focus acquisition event for triggering focus and obtaining event that the focus, which obtains event functions,
The operation executed afterwards, the focus lose event functions include trigger focus lose event movement and triggering focus lose event
The operation executed afterwards.
In the above method, the operation that executes after the triggering focus acquisition event are as follows: judge text in input frame is whether
To default display text, if so, the text in input frame is emptied, if it is not, without any processing;
The triggering focus loses the operation executed after event are as follows: judge the default display text in input frame whether be
Sky reads the attribute value of the default display text attribute of input frame described in html text, the attribute value is made if it is sky
It is filled into input frame for default display text, and reads the default display text pattern of input frame in input state migration attribute
The attribute value of attribute, according to the font style for defaulting display text in the corresponding CSS style setting input frame of the attribute value;Such as
Fruit is not sky, without any processing.
A kind of input state migration process system, comprising: Traversal Unit, input state processing unit;Wherein,
Traversal Unit, for being traversed after the completion of page initialization to page node, acquisition is moved with input state
Move the input frame of attribute;
Output state processing unit, for the input frame with input state migration attribute to be uniformly processed;It is described
Processing are as follows: the attribute value for reading the input state migration attribute of input frame in hypertext markup language html text, by the category
Property value as default prompt text be filled into input frame, and input frame and focus are obtained into event and focus loses event binding.
In above system, the input state migration attribute is added to html text in advance, as the html text
The attribute of middle input frame.
In above system, the input state migration attribute includes the default display text attribute and input frame of input frame
Default display text Style Attributes.
In above system, the attribute value of the default display text attribute of the input frame is that the default of input frame shows text
This;
The attribute value of the default display text Style Attributes of the input frame indicates the font sample of the default display text
Formula.
In above system, Traversal Unit is specifically used for when obtaining the input frame with input state migration attribute:
According to the attribute-name of preset input state migration attribute, obtaining from html text has input state to migrate attribute
Input frame, and will acquire with input state migration attribute input frame be saved in array.
In above system, the input state of input state processing unit input frame in reading html text, which migrates, to be belonged to
Property attribute value, using the attribute value as default prompt text be filled into input frame when, be specifically used for:
The input state migration attribute of corresponding input frame is obtained in html text according to input frame ID;
The attribute value that display text attribute is defaulted in input state migration attribute is read, using the attribute value as the input
The default display text of frame is filled into the input frame;
The attribute value for reading the default display text Style Attributes of input frame in input state migration attribute, according to the category
Property be worth the font style that display text is defaulted in corresponding Cascading Style Sheet CSS style setting input frame.
In above system, input frame and focus acquisition event and focus are being lost event by the input state processing unit
When binding, it is specifically used for:
Input frame object is obtained according to input frame ID, focus is added for the input frame object and obtains event functions and focus
Lose event functions;It includes the movement and triggering focus acquisition event for triggering focus and obtaining event that the focus, which obtains event functions,
The operation executed afterwards, the focus lose event functions include trigger focus lose event movement and triggering focus lose event
The operation executed afterwards.
In above system, the operation that executes after the triggering focus acquisition event are as follows: judge text in input frame is whether
To default display text, if so, the text in input frame is emptied, if it is not, without any processing;
The triggering focus loses the operation executed after event are as follows: judge the default display text in input frame whether be
Sky reads the attribute value of the default display text attribute of input frame described in html text, the attribute value is made if it is sky
It is filled into input frame for default display text, and reads the default display text pattern of input frame in input state migration attribute
The attribute value of attribute, according to the font style for defaulting display text in the corresponding CSS style setting input frame of the attribute value;Such as
Fruit is not sky, without any processing.
As can be seen from the above technical solutions, provided by the invention to have the advantages that
Technical solution of the present invention can be improved the development efficiency of input frame in the page, reduce human cost and material resources at
This;The attribute value that processing logic needs only needs to obtain in html text, convenient to modify to the variable of input frame
And extension;The size of code that logical process program can be greatly reduced improves the operational efficiency of code, realizes the efficient place of batch
Reason.
[Detailed description of the invention]
Fig. 1 is the flow diagram for the preferred embodiment that the present invention realizes input state emigration processing method;
Fig. 2 is the structural schematic diagram for the preferred embodiment that the present invention realizes input state migration process system.
[specific embodiment]
The basic idea of the invention is that: after the completion of page initialization, page node is traversed, obtaining has input shape
The input frame of state migration attribute;Input frame with input state migration attribute is uniformly processed;The processing are as follows: read
The attribute value of the input state migration attribute of input frame in hypertext markup language html text, using the attribute value as default
Prompt text is filled into input frame, and input frame and focus acquisition event and focus are lost event binding.
To make the objectives, technical solutions, and advantages of the present invention clearer, right in the following with reference to the drawings and specific embodiments
The present invention is described in detail.
The present invention provides a kind of input state emigration processing method, and Fig. 1 is that the present invention realizes input state migration process side
The flow diagram of the preferred embodiment of method, as shown in Figure 1, the preferred embodiment the following steps are included:
Step 101, input state is added for input frame in the html text for saving input frame object migrate attribute.
Specifically, attribute required for being migrated using configuration information setting input state, configuration information refer to that configuration exists
Information in hypertext markup language (HTML, Hypertext Markup Language) text is input frame in html text
Object, can be in page load input frame, this preferred embodiment, in configuration information using input frame object in html text
It configures input state and migrates attribute, therefore, the input state migration attribute of configuration is just used as the attribute of input frame to exist, thus real
Addition input state migrates attribute in the attribute of present input frame, is each to need input state migration mechanism using which
Input frame all adds input state migration attribute;The input state migration attribute includes the default display text attribute of input frame
With the default display text Style Attributes of input frame;The input state migration attribute will use in JavaScript code,
Input state migration attribute is configured in html text can be convenient JavaScript code calling.
For example, not adding the input frame of input state migration attribute for user name input frame are as follows:
<input id=”userName”type=”text”/>
Add the input frame of input state migration attribute are as follows:
< input id=" userName " type=" text " defaultValue=" your user name please be input "
defaultStyle=”gracyText/>
Wherein, defaultValue is the attribute-name of the default display text attribute of input frame, please input your user name
For the attribute value of the default display text attribute of input frame, indicate that the default display text in user name input frame is that please input you
User name;DefaultStyle is the attribute-name of the default display text Style Attributes of input frame, and gracyText is input frame
Default display text Style Attributes attribute value, indicate user name input frame in default display text font color be
GracyText, the gracyText indicate grey in CSS style;When the default display text in input frame is that please input you
When user name, the font color of the default display text is grey;Here, defaultValue attribute and defaultStyle belong to
Property be all disposed on ID be userName input frame on attribute;In this preferred embodiment, realized using html text defeated
The configuration for entering the input state migration attribute of frame, can very easily modify input state migration attribute (such as
DefaultValue attribute value).
Cascading Style Sheet (CSS, Cascading Style Sheet) is also known as style design table (SS, Style
Sheet), for carrying out web page style design, for example, link word is blue when not clicking on, when mouse is moved on link word
Become red later and have underscore, here it is a kind of styles;CSS code is stored in CSS file, is defined in CSS file
Many CSS style names, are associated with CSS style by the class attribute of page elements in html text, for example, html text
In have input frame:<input type=" text " class=" blueText "/>, such input frame just passes through class Attribute Association
The pattern of the entitled blueText of pattern, by the pattern for defining the entitled blueText of pattern in CSS file, so that it may control
Input frame shows pattern defined in CSS.
Such as: there is following CSS code:
Step 102, after the completion of page initialization, page node is traversed, obtaining, there is input state to migrate attribute
Input frame.
Specifically, the processing logic generated after JavaScript code encapsulation is to page node after the completion of page initialization
It is traversed, page node mainly includes picture, text, input frame etc.;For the input frame in page node, handle logic according to
It according to the attribute-name of preset input state migration attribute, is searched in html text, obtains the input for having input state migration attribute
Frame;The input frame with input state migration attribute that processing logic will acquire all is saved in the same array, the array
It is exactly input frame set comprising more than one input frame, such as { input frame 1, input frame 2 ... ..., input frame N }.
Step 103, the input frame with input state migration attribute is uniformly processed, reads in html text and inputs
The attribute value is filled into input frame by the attribute value of the input state migration attribute of frame, and will input
Frame and focus obtain event and focus loses event binding.
Specifically, processing logic carries out at unified batch the input frame with input state migration attribute in array
Reason;The processing specifically:
Firstly, processing logic traverses the array for saving input frame, for the input frame traversed, according to input frame
ID obtains the input state migration attribute of corresponding input frame in html text, and it is aobvious to read default in input state migration attribute
The attribute value for showing text attribute is filled into the attribute value as the default display text of the input frame in the input frame, simultaneously
The attribute value of the default display text Style Attributes of input frame in input state migration attribute is read, it is corresponding according to the attribute value
The font style that display text is defaulted in input frame is arranged in CSS style.
Then, after the filling and setting of the default display text that processing logic completes input frame, need the input frame and
Focus obtains event and focus loses event binding, and the method for binding is that processing logic basis input frame ID obtains input frame pair
As adding focus acquisition event functions for the input frame object and focus losing event functions, focus obtains event functions and includes
Triggering focus obtains the movement of event and triggers the operation executed after focus acquisition event, and it includes triggering that focus, which loses event functions,
Focus loses the movement of event and triggering focus loses the operation executed after event;In this preferred embodiment, triggering focus is obtained
The operation executed after event are as follows: judge whether the text in input frame is default display text, if it is, emptying in input frame
Text keep the text in input frame constant if it is not, then without any processing;Triggering focus is held after losing event
Capable operation are as follows: judge whether the default display text in input frame is sky, if it is sky, reads the input in html text
The attribute value of the default display text attribute of frame is filled into the attribute value as default display text in input frame, and reads
Input state migrates the attribute value of the default display text Style Attributes of input frame in attribute, according to the corresponding CSS of the attribute value
The font style that display text is defaulted in input frame is arranged in pattern;If being not sky, without any processing, input frame is kept
In text it is constant;Here, losing event for input frame binding focus acquisition event and focus is the input for detecting user
Then state can make different processing according to different input states.
For example, processing logic basis input frame ID obtains input frame object:
var userName=document.getElementById(“userName”);
Handling logic is that input frame binds focus acquisition event:
userNameInput.addEventListener(“focus”,function())
Processing logic is that input frame binding focus loses event:
userNameInput.addEventListener(“blur”,function())
Above-mentioned code is expressed as this input frame object of userNameInput addition focus and obtains event functions
AddEventListener (" focus ", function ()) and focus lose event functions addEventListener
("blur",function());Wherein, addEventListener and addEventListener be function name, focus and
Blur respectively indicates triggering focus and obtains the movement of event and trigger the movement that focus loses event, and function () indicates touching
Hair focus obtains event or focus loses the operation that event post-processing logic needs to be implemented.
The processing logic all carries out above-mentioned processing to input frame different in array, realizes defeated to more than one in array
Enter frame and carries out batch processing.
In this preferred embodiment, the focus that input frame can be triggered when mouse clicks input frame obtains event, works as mouse
The focus that input frame can be triggered when clicking the region other than input frame loses event, therefore is burnt for the event of input frame binding
Point acquisition event and focus lose event, rather than mouse click event, because deratization punctuate hits the coke that can trigger input frame
Point acquisition event, the focus that the operation of keyboard can also trigger input frame obtain event.
Wherein, processing logic inputs numerical value in input frame and can be realized by the way that the value attribute of input frame is arranged, example
Such as:
Input frame object is obtained by input frame ID:
var userName=document.getElementById(“userName”);
Then the input value that the input frame object is arranged is " 123 "
userNameInput.Value=“123”
In this preferred embodiment, when needing to empty the text in input frame, the input value that input frame object can be set is
Sky, such as: userNameInput.Value=" "
To realize the above method, the present invention also provides a kind of input state migration process system, which is located at processing and patrols
In volume, Fig. 2 is the structural schematic diagram for the preferred embodiment that the present invention realizes input state migration process system, as shown in Fig. 2, should
System includes: Traversal Unit 20, input state processing unit 30;Wherein,
Traversal Unit 20, for being traversed after the completion of page initialization to page node, obtaining has input state
Migrate the input frame of attribute;
Output state processing unit 30, for the input frame with input state migration attribute to be uniformly processed;Institute
State processing are as follows: the attribute value for reading the input state migration attribute of input frame in hypertext markup language html text, it will be described
Attribute value is filled into input frame as default prompt text, and input frame and focus acquisition event and focus are lost event and tied up
It is fixed.
Wherein, input state migration attribute is added to html text in advance, as inputting in the html text
The attribute of frame.The input state migration attribute includes the default display text attribute of input frame and the default display text of input frame
This Style Attributes.The attribute value of the default display text attribute of the input frame is the default display text of input frame;It is described defeated
The attribute value for entering the default display text Style Attributes of frame indicates the font style of the default display text.
Wherein, Traversal Unit 20 is specifically used for when obtaining the input frame with input state migration attribute:
According to the attribute-name of preset input state migration attribute, obtaining from html text has input state to migrate attribute
Input frame, and will acquire with input state migration attribute input frame be saved in array.
Wherein, the input state of the input state processing unit 30 input frame in reading html text migrates attribute
Attribute value is specifically used for when the attribute value is filled into input frame as default prompt text:
The input state migration attribute of corresponding input frame is obtained in html text according to input frame ID;
The attribute value that display text attribute is defaulted in input state migration attribute is read, using the attribute value as the input
The default display text of frame is filled into the input frame;
The attribute value for reading the default display text Style Attributes of input frame in input state migration attribute, according to the category
Property be worth the font style that display text is defaulted in corresponding Cascading Style Sheet CSS style setting input frame.
Wherein, input frame and focus acquisition event and focus are being lost event binding by the input state processing unit 30
When, it is specifically used for:
Input frame object is obtained according to input frame ID, focus is added for the input frame object and obtains event functions and focus
Lose event functions;It includes the movement and triggering focus acquisition event for triggering focus and obtaining event that the focus, which obtains event functions,
The operation executed afterwards, the focus lose event functions include trigger focus lose event movement and triggering focus lose event
The operation executed afterwards.
Wherein, the operation executed after the triggering focus acquisition event are as follows: judge whether the text in input frame is default
Display text, if so, the text in input frame is emptied, if it is not, without any processing;
The triggering focus loses the operation executed after event are as follows: judge the default display text in input frame whether be
Sky reads the attribute value of the default display text attribute of input frame described in html text, the attribute value is made if it is sky
It is filled into input frame for default display text, and reads the default display text pattern of input frame in input state migration attribute
The attribute value of attribute, according to the font style for defaulting display text in the corresponding CSS style setting input frame of the attribute value;Such as
Fruit is not sky, without any processing.
Technical solution of the present invention is not used, needs according to ID to be obtained input frame one by one in JavaScript code
It takes, is then successively handled by processing logic, if there is 10 input frames to be treated, it is necessary in JavaScript code
10 corresponding processing logics are edited, because the default display text of each input frame is different, i.e., in each input frame
Relevant variable is migrated with different input states, but the corresponding processing logic of input frame is similar.
After technical solution of the present invention, by the input state migration attribute configuration of input frame in html text,
Such as:<input type=" text " id=" userName " defaultValue=" your user name please be input "/>.In this way, place
Reason logic does not need to obtain one by one according to input frame ID in processing, it is only necessary to by the input configured with input state migration attribute
Frame is got, and is then traversed, is uniformly processed to more than one input frame got, and processing logic only needs to configure
One, for example, JavaScript code is configurable to:
If (input frame of userName currently input it=the defaultVlaue attribute of the input frame of=userName
Value)
The current input value of the input frame of username is set to null value;
}
Therefore, technical solution of the present invention can be improved the development efficiency of input frame in the page, reduce human cost and object
Power cost;The attribute value that processing logic needs only needs to obtain in html text, and the convenient variable to input frame carries out
Modifications and extensions;It handles logic and generation is encapsulated by JavaScript code, in practical application, only needing to configure in html text
Input frame input state migration attribute attribute value, processing logic will automatically to configuration input state migrate attribute
Input frame be uniformly processed, greatly reduce the size of code of logical process program, improve the operational efficiency of code, realize batch
The efficient processing of amount.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.
Claims (14)
1. a kind of input state emigration processing method, which is characterized in that this method comprises:
After the completion of page initialization, page node is traversed, obtains the input frame with input state migration attribute;It obtains
The method of input frame with input state migration attribute are as follows: the attribute-name that attribute is migrated according to preset input state, from
The input frame for having input state migration attribute is obtained in html text, and what be will acquire migrates the defeated of attribute with input state
Enter frame and is saved in array;
Input frame with input state migration attribute in the array is uniformly processed;The processing are as follows: read super literary
The attribute value of the input state migration attribute of input frame, prompts the attribute value as default in this markup language html text
Text is filled into input frame, and input frame and focus acquisition event and focus are lost event binding.
2. the method according to claim 1, wherein input state migration attribute is added to HTML in advance
Text, the attribute as input frame in the html text.
3. the method according to claim 1, wherein input state migration attribute includes the default of input frame
The default display text Style Attributes of display text attribute and input frame.
4. according to the method described in claim 3, it is characterized in that,
The attribute value of the default display text attribute of the input frame is the default display text of input frame;
The attribute value of the default display text Style Attributes of the input frame indicates the font style of the default display text.
5. the method according to claim 1, wherein the input state for reading input frame in html text moves
The attribute value is filled into input frame by the attribute value for moving attribute specifically:
The input state migration attribute of corresponding input frame is obtained in html text according to input frame ID;
The attribute value that display text attribute is defaulted in input state migration attribute is read, using the attribute value as the input frame
Default display text is filled into the input frame;
The attribute value for reading the default display text Style Attributes of input frame in input state migration attribute, according to the attribute value
The font style of display text is defaulted in corresponding Cascading Style Sheet CSS style setting input frame.
6. the method according to claim 1, wherein described lose input frame and focus acquisition event and focus
Event binding specifically:
Input frame object is obtained according to input frame ID, focus acquisition event functions is added for the input frame object and focus loses
Event functions;It includes triggering focus to obtain the movement of event and hold after triggering focus acquisition event that the focus, which obtains event functions,
Capable operation, the focus lose event functions include trigger focus lose event movement and triggering focus lose event after hold
Capable operation.
7. according to the method described in claim 6, it is characterized in that,
The operation executed after the triggering focus acquisition event are as follows: judge whether the text in input frame is default display text,
If so, the text in input frame is emptied, if it is not, without any processing;
The triggering focus loses the operation executed after event are as follows: judges whether the default display text in input frame is sky, such as
Fruit is sky, reads the attribute value of the default display text attribute of input frame described in html text, using the attribute value as silent
Recognize display text to be filled into input frame, and reads the default display text Style Attributes of input frame in input state migration attribute
Attribute value, according to the font style for defaulting display text in the attribute value corresponding CSS style setting input frame;If no
For sky, without any processing.
8. a kind of input state migration process system, which is characterized in that the system includes: Traversal Unit, input state processing list
Member;Wherein,
Traversal Unit, for being traversed after the completion of page initialization to page node, obtaining, there is input state migration to belong to
The input frame of property;Traversal Unit is specifically used for: when obtaining the input frame with input state migration attribute according to preset defeated
The attribute-name for entering state transition attribute obtains the input frame for having input state migration attribute from html text, and will acquire
With input state migration attribute input frame be saved in array;
Output state processing unit, for being carried out at unified to the input frame with input state migration attribute in the array
Reason;The processing are as follows: the attribute value for reading the input state migration attribute of input frame in hypertext markup language html text, it will
The attribute value is filled into input frame as default prompt text, and input frame and focus acquisition event and focus are lost event
Binding.
9. system according to claim 8, which is characterized in that the input state migration attribute is added to HTML in advance
Text, the attribute as input frame in the html text.
10. system according to claim 8, which is characterized in that the input state migration attribute includes the silent of input frame
Recognize the default display text Style Attributes of display text attribute and input frame.
11. system according to claim 10, which is characterized in that
The attribute value of the default display text attribute of the input frame is the default display text of input frame;
The attribute value of the default display text Style Attributes of the input frame indicates the font style of the default display text.
12. system according to claim 8, which is characterized in that the input state processing unit is reading html text
The attribute value is filled into input frame by the attribute value of the input state migration attribute of middle input frame
When, it is specifically used for:
The input state migration attribute of corresponding input frame is obtained in html text according to input frame ID;
The attribute value that display text attribute is defaulted in input state migration attribute is read, using the attribute value as the input frame
Default display text is filled into the input frame;
The attribute value for reading the default display text Style Attributes of input frame in input state migration attribute, according to the attribute value
The font style of display text is defaulted in corresponding Cascading Style Sheet CSS style setting input frame.
13. system according to claim 8, which is characterized in that the input state processing unit is by input frame and burnt
When point acquisition event and focus lose event binding, it is specifically used for:
Input frame object is obtained according to input frame ID, focus acquisition event functions is added for the input frame object and focus loses
Event functions;It includes triggering focus to obtain the movement of event and hold after triggering focus acquisition event that the focus, which obtains event functions,
Capable operation, the focus lose event functions include trigger focus lose event movement and triggering focus lose event after hold
Capable operation.
14. system according to claim 13, which is characterized in that
The operation executed after the triggering focus acquisition event are as follows: judge whether the text in input frame is default display text,
If so, the text in input frame is emptied, if it is not, without any processing;
The triggering focus loses the operation executed after event are as follows: judges whether the default display text in input frame is sky, such as
Fruit is sky, reads the attribute value of the default display text attribute of input frame described in html text, using the attribute value as silent
Recognize display text to be filled into input frame, and reads the default display text Style Attributes of input frame in input state migration attribute
Attribute value, according to the font style for defaulting display text in the attribute value corresponding CSS style setting input frame;If no
For sky, without any processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310078543.0A CN104049956B (en) | 2013-03-12 | 2013-03-12 | A kind of input state emigration processing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310078543.0A CN104049956B (en) | 2013-03-12 | 2013-03-12 | A kind of input state emigration processing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104049956A CN104049956A (en) | 2014-09-17 |
CN104049956B true CN104049956B (en) | 2019-09-20 |
Family
ID=51502866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310078543.0A Active CN104049956B (en) | 2013-03-12 | 2013-03-12 | A kind of input state emigration processing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104049956B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3338175A4 (en) * | 2016-01-25 | 2018-08-22 | Beijing Didi Infinity Technology and Development Co., Ltd. | Method and system for prompt message display |
CN106997290A (en) * | 2016-01-25 | 2017-08-01 | 滴滴(中国)科技有限公司 | Input the display methods and device of prompt message |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101217630A (en) * | 2008-01-14 | 2008-07-09 | 中兴通讯股份有限公司 | A method of graphic generation of network TV electronic program guidance system template |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100499661C (en) * | 2006-01-11 | 2009-06-10 | 杭州华三通信技术有限公司 | Port state shift method |
CN102541554B (en) * | 2011-12-27 | 2014-06-25 | 重庆新媒农信科技有限公司 | Method for realizing dynamic transparent specially good display effect of input box |
CN102937881B (en) * | 2012-11-30 | 2016-05-18 | 北京奇虎科技有限公司 | The interface assembly of the display methods of input text and demonstration input text in interface |
-
2013
- 2013-03-12 CN CN201310078543.0A patent/CN104049956B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101217630A (en) * | 2008-01-14 | 2008-07-09 | 中兴通讯股份有限公司 | A method of graphic generation of network TV electronic program guidance system template |
Non-Patent Citations (2)
Title |
---|
input文本框鼠标点击默认值消失,不输入离开鼠标恢复默认值;Randolph Liu;《博客园》;20111122;全文 * |
文本框(input)获取焦点(onfocus)时样式改变的实现方法;我爱吃苹果;《博客园》;20101015;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN104049956A (en) | 2014-09-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106371844B (en) | A kind of method and system with primary user interface components displayed web page | |
US10542123B2 (en) | System and method for generating and monitoring feedback of a published webpage as implemented on a remote client | |
DE102017111438A1 (en) | API LEARNING | |
DE112010004980B4 (en) | Improving the performance of templated Javascript widgets | |
CN105243159A (en) | Visual script editor-based distributed web crawler system | |
CN103761241B (en) | A kind of method for uploading and browser of image data | |
US20200117704A1 (en) | System and method to convert a webpage built on a legacy framework to a webpage compatible with a target framework | |
CN109657121A (en) | A kind of Web page information acquisition method and device based on web crawlers | |
CN109359231A (en) | A kind of information crawler method, server and the storage medium of distributed network crawler | |
CN103617390A (en) | Malicious webpage judgment method, device and system | |
CN109697130A (en) | Front and back end separation method, device, equipment and the storage medium of web system | |
US20170212964A1 (en) | System and method for dynamic content rendering | |
CN106934011A (en) | A kind of structuring analysis method and device of JSON data | |
Nigam et al. | Web scraping: from tools to related legislation and implementation using python | |
CN104049956B (en) | A kind of input state emigration processing method and system | |
Ravulavaru | Google Cloud AI Services Quick Start Guide: Build Intelligent Applications with Google Cloud AI Services | |
CN108885544A (en) | Front end page internationalization processing method, application server and computer readable storage medium | |
CN106294760A (en) | Sheet disposal method and server, client | |
Winter et al. | Formal information modelling for standardisation in the spatial domain | |
CN112131300A (en) | Cross-platform data making method and device based on Flutter | |
CN109002557A (en) | Method, electronic equipment based on browser rs cache mechanism optimization webpage loading velocity | |
CN112001157B (en) | Online design method and device for webpage data form | |
US20200342161A1 (en) | Declarative interface for interaction design | |
CN102789474B (en) | Method and device for processing webpage data | |
CN102929777B (en) | Network application method of testing and test macro |
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 |