The previous article mainly introduces some of the work and life of some thinking, this article mainly to collate, some of the problems encountered before, as well as solutions (there is no solution to the problem, the use of other solutions to make up).
- Demand is the mobile input box, only six digits can be entered
The product needs to be as effective as the app, and the user cannot enter characters other than the number. The idea is to listen for KeyUp's keycode, and then determine whether you can enter it based on the keycode of the input character. Ideas tend to be brought down by the cruelty of reality, which has a major problem with compatibility, and the main problems are as follows:
- Compatibility issues with input methods. Unable to get some Android input method KeyCode or KeyCode is 0, in this case basically no solution, we can not do anything to listen to what the user entered
- Browser compatibility issues. exists Although the character you entered does not appear on the page, it takes up the input box's input length and has a value at the time of submission.
The last thing to do is to limit the length of the user input, and use the HTML5 property, Type=number call the numeric keypad by default, and add friendly hints to circumvent the problem.
- Do internal management background, naturally without charts and other statistical related display
The earliest use of the Hightchars to complete, chart-related work, also organized a hightchars use of the example bar. This software is used to pay for external use, this must be noted. Recently watched a new chart look at the document and API feel very good, have the opportunity to try it, here is recommended, official website: Http://echarts.baidu.com/,github Address: Https://github.com/ecomfe/echarts
- Demand is to write a message template, compatible with a mainstream mailbox (163,qq,gmail, etc.)
The use of the scene is this, when the registration needs to send the user email, click on the activation account, or the user has sensitive actions require the mailbox to receive some verification information to complete the operation of the process. This template is done using HTML and CSS, and the control of the style of the mailbox is strict, all the class or ID and other selectors style is basically filtered out, the most reliable (when writing a Web page, is considered the most unreliable) practice is the inline style, That is, styles defined using style or its own properties are not filtered out, and can be seen here.
- Get the current document encoding format
Because of the need to provide public JS services, will be referenced to their own pages of business, but can not unify the business use the same encoding format (for historical reasons, some businesses use GBK encoding, and will not because of the introduction of our public JS for the entire site adjustment), so we need to detect the current document Encoding page. , and pass to the interface in the related operation, tells the service side, guarantees the service side to handle the user data transmission normally. Here you need to know the three attributes of document: CharSet, Defaultcharset, CharacterSet, respectively, the encoding of the page settings, the encoding of the default region, and the encoding of the document rendering. Understanding this can be based on their own needs to obtain the desired encoding type, specific examples can be seen in the "Get the current document encoding thinking"
- Browser multiple 302 adjustment, resulting in web page inaccessible
Our use of the scene, because the company many domain names need to synchronize, so that, in the exit, you need to log in the other domain name to exit, to ensure the consistency of the login status. Before the practice is to access an address, this address in the server in accordance with the configured domain name list for 302 adjustment exit, the domain name when there is no functional problem (in IE will appear on the page flashing), in the increase of the domain name, there will be too many jumps caused the page crashes. And this browser situation is not the same, it is only necessary to remember that the minimum limit is IE7, 8 is 10 times, more than 10 times the page will crash. How many restrictions are available for each browser to view browser redirection restrictions issues
- New window opens and closes
We will try window.open and window.close to open and close the new window, but one problem in the dual-core browser is that the new window cannot be closed through window.close when the window kernel created is inconsistent with the kernel of the parent window.
- In the Nodejs tide, learning Nodejs, and using the odd dance group Open source Thinkjs (http://thinkjs.org/) developed a file store and download the site, only for learning to use
- Sort out some of the tools that you might often use in your development
"JQuery Plugin-Provincial linkage" "JS to help you calculate Zodiac" "JavaScript development repeatedly see" "Local storage components-compatible with IE low version" "Collation Simple Sharing function" "Cross-domain Request Solution"
- In order to meet the business in the development process, suffer from not so many accounts leading to the situation of development progress, learning the plug-in development, and the development of an account-related plug-in, in the process encountered a problem, the latest Chrome browser can not use the unofficial store download plugin, At this point @snadn offers a solution that is perfectly solved. You can read about Chrome's inability to use the unofficial store extension solution
Here just to tidy up their work has encountered problems and solutions, can not say that these methods are their own original, most of the reference network you share the implementation of the method, the use of their own in the process of sorting. Some people will say: the articles that introduce these questions are everywhere, is it necessary to write them again? What's the use of doing such repetitive work? I do not know whether there is an accurate answer to this question, here I would like to say why I do this:
- The information on the internet has a lot of problems, in the use of the process, and encountered a variety of problems, access to the time before the collation did not find, here I can organize and accumulate, if you can bring help to others, it is certainly a wish
- Others are never their own, they have done to know what problems, should be how to solve, this process is what we want more, or we can improve the place
- Is my own study, accumulation, precipitation of a process, just today I found that I have encountered so many problems, if not recorded at that time, maybe I have forgotten
Said a lot, are some of their own ideas, but also hope to communicate with you.
Miscellaneous notes (bottom)