With the continuous promotion of Web2.0 technology, more and more applications use JavaScript technology to process the client, so that the performance of JavaScript in the browser becomes the most important usability problem that developers face. This problem is compounded by the blocking nature of JavaScript, which means that when the browser executes JavaScript code, it cannot do anything else at the same time. This article describes in detail how to properly load and execute JavaScript code to improve its performance in the browser.
In Java EE programming, we touch the most scripting language or JavaScript. In using JavaScript, we usually consider their performance issues, so summarize the day-to-day summary of JavaScript performance optimization to prepare for the query.
A string concatenation problem is often encountered in the use of JavaScript. I would like to ask you to use Java programming when you encounter the above problems, how to deal with?
NX Students: Teachers, using Stringbulider or StringBuffer
Teacher: Correct answer, use StringBuilder or stringbuffer can avoid too much create object, reduce system performance.
Well, back to the point, we're still here to answer the question of how to deal with these problems in using JavaScript.
First, let's look at the NX students ' approach:
The teacher looked at NX students to achieve the way, almost laugh spray. This kind of garbage realization way, really ruined your one Life fame ah.
The teacher said with a smile: "You realize this way is equivalent to the level of primary school students, is a pile of garbage random combination of letters." Said only heard SB teacher on the keyboard on the key step of the swift knock its code to. NX students have not yet responded, the teacher has completed the code:
By comparing the above code, the teacher's code performance is significantly better than the NX students code, NX student code will often lead to IE downtime.
NX students see the results of the code run, immediately to the teacher's admiration, decided to humbly want teachers to learn, and constantly improve themselves ...
The story ended, but the teacher and NX student's JavaScript tour continued ...