functionserviceUser(){
$('.ergodicPersonList').remove();
$.ajax({
url: "/business/findpersons.json",
dataType: "json",
type:"GET",
success: function(doc) {var objs=eval(doc);
for (var i = 0; i < objs.length; i++){
var personid=objs[i].personId;
var name=objs[i].personName;
var email=objs[i].personEmail;
var sector=objs[i].personSector;
var position=objs[i].personPosition;
var password=objs[i].personPassword;
$("#personList thead").append(
"
"+
"
"+name+"
"+
"
"+password+"
"+
"
"+email+"
"+
"
"+position+"
"+
"
" class='deletePersonBut'>
"+
"
" class='updataPersonBut'>
"+
"
"
);
var getA = "#personList .deletePersonBut[name="+ i + "]";//就这里获取的原因,那个i=objs.length的原因,感觉应该就是闭包的问题。
$(getA).click(function(){var thid=$(this).parent();
var pid=thid.children(".deletePersonBut").attr('name');
deletePersonButMethod(objs[pid].personId);
});
var getA = "#personList .updataPersonBut[name="+ i + "]";//就这里获取的原因,那个i=objs.length的原因,感觉应该就是闭包的问题。
$(getA).click(function(){var thid=$(this).parent();
var pid=thid.children(".updataPersonBut").attr('name');
updataPersonButMethod(objs[pid].personId,objs[pid].personName,objs[pid].personEmail,objs[pid].personSector,objs[pid].personPosition,objs[pid].personType,objs[pid].personPassword);
});
}
}
});
$('#closePersonListBut').click(function(){
$('#personList').hide();
$('body').css('background','#fff');
});
functiondeletePersonButMethod(id){
$.ajax({
url: "/business/personDelete.json",
dataType: "json",
data:{
person_id:id,
},
type:"GET",
complete: function(doc) {
serviceUser();
}
});
};
functionupdataPersonButMethod(personId,personName,personEmail,personSector,personPosition,personType,personPassword){
$('#tab_con_2').remove();
$('body').append(
"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml&q
// for循环的进化
// 菜鸟
for (var i = 0; i < Things.length ; i++) {
// Things[i]
}
// 老鸟
for (var i = 0, len = Things.length; i < len; i++) {
// Things[i]
}
// 大师
for (var i = Things.le
the idea is from:
http://blog.csdn.net/zhanxinhang/article/details/6731134
public class MaxSubMatrix {
/**see http://blog.csdn.net/zhanxinhang/article/details/6731134
* Q35
求一个矩阵中最大的二维
使用cordova可以很方便的在手机sdcard中读写文件。
首先需要安装cordova插件:file
命令为:
cordova plugin add org.apache.cordova.file
然后就可以读写文件了,这里我先是写入一个文件,具体的JS代码为:
var datas=null;//datas need write
var directory=&
SELECT cust_id,
SUM(price) as total
FROM orders
WHERE status = 'A'
GROUP BY cust_id
HAVING total > 250
db.orders.aggregate( [
{ $match: { status: 'A' } },
{
$group: {