{"id":103757,"student_id":1998,"content":"var name = prompt('名字?') || '你想說什麼?';\nvar comments = []\nvar users = {\n 111: {\n id: 1, name: \"Test\"\n },\n 2: {\n id: 2, name: \"Test2\"\n },\n 23: {\n id: 3, name: \"Test3\"\n }\n}\nvar random = Math.floor(Math.random() * 10000) + 1\nusers[random] = {\n id: random,\n name: name,\n time: Date.now()\n};\nDB.broadcast('update', users[random]);\nDB.onMessage('update', function (data) {\n users[data.id] = data;\n});\nforever(function() {\n for (var id in users) \n if (Date.now() - users[users.id].time \u003e 1000) {\n comment.push(users[users.id].name + '離開了聊天室')\n delete users[id]\n }\n });\n when('click', function () {\n var msg = '[' +(new Date).toLocaleTimeString() + ']' + name + ':'+ prompt('?');\n comments.push(msg);\n DB, broadcast('message', msg)\n })\n\n DB.onMessage('message', function (data) {\n comments.push(data);\n })","created_at":"2019-11-02T10:05:37.874+08:00","updated_at":"2019-12-20T21:41:11.877+08:00","name":"聊天室 副本","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/103757/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":34007,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":58,"hashid":"zpese83n","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
到這台電腦