1

Web サーバーから取得した XML 変数があり、jquery / javascript を使用して、ループせずにローカル db テーブルに挿入したい (ループは非常に遅い....)

挿入に現在使用しているコードは次のとおりです。

   $(xx).find("Customers").each(function () {
         var $this = $(this),
             CustID = $this.find("CustID").text(),
             CustName = $this.find("CustName").text(),
             City = $this.find("City").text(),
             PhoneNum = $this.find("PhoneNum").text()
         // guid = $this.find("guid").text(),
         //  postid = $this.find("postid").text(),
         //  url = $this.find("enclosure").attr('url');
         i++;
         db.transaction(function (tx) {
             tx.executeSql('INSERT INTO Customers (CustID, CustName, City, PhoneNum) VALUES (?,?,?,?)', [CustID, CustName, City, PhoneNum]);
         });
     });

XX は xml 変数です。

誰かがその例を持っていますか?

ありがとう、

4

0 に答える 0