日期:2014-05-16  浏览次数:20293 次

草,js闭包循环(自己留着看的)

(function(_note){
??? ??? ??? ??? ??? ??? ??? ??? function xxx(){
??? ??? ??? ??? ??? ??? ??? ??? ??? //chrome端更新
??? ??? ??? ??? ??? ??? ??? ??? ??? if (ds.rows.length) {
??? //??? ??? ??? ??? ??? ??? ??? ??? ??? alert("note.opt=='2',更新...");
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? /*//更新desc
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? db.tx({name : 'update_desc',
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? id : note.lid,
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? data : note.content
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? }, function() {
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? });*/
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? //置更新tag=0
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? db.tx({name : 'update_tag',
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? id : _note.lid,
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? data : '0'
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? }, function() {
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? });
??? ??? ??? ??? ??? ??? ??? ??? ??? }else{
??? ??? ??? ??? ??? ??? ??? ??? ??? //其他端新增
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? alert("note.opt=='2',新增...");
??? ??? ??? ??? ??? ??? ??? ??? ??? }
??? ??? ??? ??? ??? ??? ??? ??? }
??? ??? ??? ??? ??? ??? ??? ??? db.tx({
??? ??? ??? ??? ??? ??? ??? ??? ??? name : 'load_note_by_noteid',
??? ??? ??? ??? ??? ??? ??? ??? ??? noteid : note.noteid
??? ??? ??? ??? ??? ??? ??? ??? }, function(tx, ds) {
??? ??? ??? ??? ??? ??? ??? ??? ??? xxx();
??? ??? ??? ??? ??? ??? ??? ??? });
??? ??? ??? ??? ??? ??? ??? })(note);