1. Put the definition of the number of loops outside the loop: This seems to be the same in all languages, and the effect becomes more and more obvious when there are more than 100 elements. That is to say, for(var i=0;i
2. Change multi-layer object references to shorter path references: In JavaScript, this problem is very obvious, such as proposalNo field var proposalNoField = fm.proposalNo. The difference between using proposalNoField.value and fm.proposalNo.value in a loop (100+ times) is huge. So try to shorten the access path by using intermediate variables.
3. Impact of third-party JavaScript packages: Since JavaScript supports prototypes, such as prototype.js, it modifies some behaviors of Array. Sometimes there is no problem with the code you write, but if the prototype is modified, it will also happen. Problems, such as prototype.js version 1.4, have bugs, and array sorting in some cases can lead to an infinite loop.