我收到一些非常大的字符串作为Ajax请求的响应,用于在前端生成视图。将大字符串作为参数传递 - 未优化?
我知道是否它的一个对象,然后对该对象的引用作为参数传递。但是String的情况如何?优化传递非常大的字符串作为参数是不好的?
fetchData(empId, date1, date2).done(function(response) {
//here response is a very large string
...
..
createView(response);
refreshCumulatives(response);
...
..
}).fail(function(jqXHR, textStatus, errorThrown) {
});
没关系。在性能方面,这取决于你打算用这个字符串做什么? – mohamedrias