Date: 2013-7-3 Source: gbin1.com
There is a very simple client optimization method, that is, using array. Prototype. Join to replace the original basic character connection method. In the first article of this series, I used the basic character connection in the Code:
Htmlstr + = '<li>' + item. Text + '</LI> ';
But in the following code, I used optimization:
VaR items = []; ajaxresult. items. foreach (function (item) {// construct string items. push ('<li>', item. text, '</LI>') ;}); // you can use innerhtml to set the list content document. queryselector ('ul '). innerhtml = items. join ('');
It may take you a little time to see what the array is for, but all users have benefited a lot from this optimization.
Next, we will talk about using CSS animation at the front end as much as possible.
Via geeks
Source: front-end performance optimization: Use array. Prototype. Join to replace string connections