gistfile1.txt //打印日志函数function putConsole(data, id) { if (logSwitch) { switch (id) { case 0: //如果data为JSON对象转为字符串打印 console.log(JSON.stringify(data)); break; case 1: //data为字符串直接打印 console
//打印日志函数
function putConsole(data, id) {
if (logSwitch) {
switch (id) {
case 0: //如果data为JSON对象转为字符串打印
console.log(JSON.stringify(data));
break;
case 1: //data为字符串直接打印
console.log(data);
break;
case 2: //弹出字符串数据
alert(data);
break;
case 3: //弹出data为JSON对象转为字符串
alert(JSON.stringify(data));
break;
}
}
}
