{"id":21343,"student_id":1976,"content":"var commets = []\n\nvar name = prompt('請輸入名字');\n// var users = {\n// }\n\n// var idname = Math.random()*10000;\n// idname = Math.floor(idname);\n\n// users[idname] = {\n// id : idname,\n// name : name,\n// time : Date.now()\n// }\n\nwhen(\"click\",function(){\n var msg = prompt('請輸入你要講的話');\n var time = new Date()\n time = time.toLocaleTimeString()\n var data = \"[\" + time + \"]\" + name +\":\"+msg\n commets.push(data);\n DB.broadcast(\"message\",data);\n})\n\nforever(function(){\n // users[idname].time = Date.now()\n // DB.broadcast(\"update\",users[idname])\n // var x = 0;\n for(var i = 0 ;i\u003ccommets.length;i++){\n print(commets[i],100,60+20*i);\n }\n\n // for(var id in users){\n // print(users[id].name,10,60+20 * x)\n // x = x + 1; \n\n // if( (Date.now()-users[id].time) \u003e 3000){\n // delete users[id]\n // }\n // }\n\n});\n\nDB.onMessage(\"message\",function(data){\n console.log(data);\n commets.pushg(data);\n})\n\n// DB.onMessage(\"update\",function(data){\n// users[data.id] = data;\n// })\n\n","created_at":"2018-02-01T13:59:01.392+08:00","updated_at":"2019-10-22T12:34:46.945+08:00","name":"emptyJS","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/21343/23cbc76f82e61a35cfbb65e35e9595b3.jpg"},"parent_id":14981,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":344,"hashid":"qmds3g2d","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦