Limitations of js itself. Do not let javascript do too much.

Source: Internet
Author: User

Someone even asked me, "there are five text boxes on the page. Each text box can only enter one character. How can I use JavaScript to automatically jump to the second one after the user enters the first text box .".

I said that this function should not be implemented by Tab? After the user inputs, just press the Tab key, and the user can also control whether to switch to the next one (because the user may also input an error ).

But he insisted that it was what the boss demanded. I finally had to help him implement this function. But it is strange.


When I used to use js just now, I felt that js was amazing and could make some complicated functions simple and easy. Later, I learned that JavaScript cannot do many things, such as operating client files.

At that time, I often complained why JavaScript cannot implement the functions that can be implemented in other languages, so I did a lot of things that should not have been done by js myself.

Once, to read a resource file, I wrote hundreds of lines of code in Javascript, and only read a row of content in xml, later, when I returned the code, I found that the previously written code can be implemented using vb.net or C # Up to five lines.


I think js should not do too many additional events. Another reason is the limitation of js itself. js runs on the client and all code is sent to the client machine for execution. As a result, some logic like encrypting user data should not be implemented in js.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.