Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用phonegap在jquery mobile中加载大型xml文件时,如何减少加载时间 I'm on creating jquery mobile app in phonegap 0.9.6. intend to create array type of_Jquery_Xml_Json - Fatal编程技术网

使用phonegap在jquery mobile中加载大型xml文件时,如何减少加载时间 I'm on creating jquery mobile app in phonegap 0.9.6. intend to create array type of

使用phonegap在jquery mobile中加载大型xml文件时,如何减少加载时间 I'm on creating jquery mobile app in phonegap 0.9.6. intend to create array type of,jquery,xml,json,Jquery,Xml,Json,使用phonegap在jquery mobile中加载大型xml文件时,如何减少加载时间 I'm on creating jquery mobile app in phonegap 0.9.6. intend to create array type of json object after loading xml data like this '[{"a":"val01", "b":"val02"}, {"a":"val03", "b":"val04"}, ...]'. a, b are co

使用phonegap在jquery mobile中加载大型xml文件时,如何减少加载时间 I'm on creating jquery mobile app in phonegap 0.9.6. intend to create array type of json object after loading xml data like this '[{"a":"val01", "b":"val02"}, {"a":"val03", "b":"val04"}, ...]'. a, b are column name. but taking a so long time(14 secs) in case of loading large size xml data. - first xml - size : 1.45MB, time : 13.54s (4013 rows, 11 columns) - second xml - size : 827.15KB, time : 59ms (3128 rows, 6 columns) first xml is just below double size of second xml. but loading time is not double. I don't know why loading first xml takes so long time. So I need your help and advice. thanks.
function CreateObj() {
var arr = [];
var colCnt = $(inputXML).find('RECORD').first().children().length; //column length
//loop rows count
$(inputXML).find('RECORD').each(function() {
    var row = {};
    for (var i = 0; i < colCnt; i++) {
        row[columnName] = Trim(columnValue);
    }
    arr.push(row);
});
return arr; }
function LoadXMLData(file) {    
$.ajax({
    type: "GET",
    url: "data/" + file + ".xml",
    dataType: "xml",
    async: true,
    error: function(xhr, status, err) {
        var errMsg = (err) ? xhr + "\n" + status + ":" + err : "";
        navigator.notification.alert(errMsg + "\nData not loaded. Retry This App", onAlert);
    },
    success: function(data, status, xhr) {
        xmlDocs[file] = CreateObj();
    }
});  }