内部函数不允许在javascript中修改对象

时间:2013-06-28 07:08:58

标签: javascript jquery sqlite cordova

在此代码中,内部函数callbackCurrency不允许修改span id的更改。 这是来自其他功能的回调函数。 它在console.log

中给出错误“No_MODIFICATION_ALLOWED”
loadAccForConVoucher = function() {
    document.getElementById('conFromAccount').innerHTML = "";
    document.getElementById('conToAccount').innerHTML = "";
    $.mobile.eazydb.transaction(function(tx) {
        tx.executeSql('SELECT Account_Name FROM Account WHERE Account_Parent_ID IN("bank", "cash")', [],
            function(tx, rs){
                if(rs.rows.length == 0) {
                    alert('There is no account. please create accounts in bank or cash group to use this feature.');
                } else {
                    $.mobile.changePage( $("#contraVoucher"), { transition: "none"} );
                    for(var i = 0;i < rs.rows.length; i++) {
                        $("#conFromAccount").append('<option value="'+rs.rows.item(i).Account_Name+'">'+rs.rows.item(i).Account_Name+'</option>');
                        $("#conFromAccount").selectmenu("refresh");
                        $("#conToAccount").append('<option value="'+rs.rows.item(i).Account_Name+'">'+rs.rows.item(i).Account_Name+'</option>');
                        $("#conToAccount").selectmenu("refresh");
                    }

                    var callbackCurrency = function(response){ 
                        alert('response is : '+response);
                        document.getElementById('currency').innerHTML = response;
                    }
                    getCurrency(callbackCurrency);
                }
          });
      });
}

0 个答案:

没有答案