我正在使用 jquery+html5 开发客户端应用程序
我将数据存储在一个文件中 (70 MB)
数据.json:
var myData = [
{
"id":"000000001",
"title":"title1",
"contents": [
{"title":"title11", "description": "description", "text":"textextxxxxxxxx"}
{"title":"title12", "description": "description", "text":"textextxxxxxxxx"}
{"title":"title13", "description": "description", "text":"textextxxxxxxxx"}
]
}
,.........
,.........
70Mb
]
//Application read this file and show "values" on console :
var data = myData
jQuery.each(data, function(){
iterObject(this)
})
iterObject : function(obj){
var self = this
$.each(obj, function(key, value) {
if((typeof value) == 'object'){
self.iterObject(value)
}
else {
console.log(value)
}
})
}
问题是它工作得很慢
快速读取大对象的最佳方法是什么?
谢谢