看板 Ajax 關於我們 聯絡資訊
請教版上高手 近期跟著'一次搞懂JavaScript 全端技術.."這本書自學 用express建立專案 安裝npm 現在照著書上的程式碼和路徑跟著寫一次 但卻無法運行 找好久找不到原因 資料夾長相: https://imgur.com/TzQRCdE Js: https://imgur.com/nBIlemg https://imgur.com/TYPBWYl 更正為下: https://imgur.com/T3Szgtx https://imgur.com/Q9N2Ps1 https://imgur.com/TGdsxWe Html: https://imgur.com/5xmDwFD https://imgur.com/0BFb0i0 CSS: https://imgur.com/iMP5Ir2 api.js: https://imgur.com/LuOoV6R app.js: https://imgur.com/GRsx7YC -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.161.79.20 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Ajax/M.1584343921.A.EAA.html ※ 編輯: wahahahaaa (118.161.79.20 臺灣), 03/16/2020 15:33:17
icydream: 不能正常執行的錯誤訊息是? 03/16 16:42
想要新增一筆待辦清單 輸入完內容 按確認 網頁沒有反應 https://imgur.com/cuFHjPG https://imgur.com/jWTWfUl ※ 編輯: wahahahaaa (118.161.79.20 臺灣), 03/16/2020 17:00:23
tino1991: js Line:10, 21 的newList() 在哪? 03/16 17:17
tino1991: 瀏覽器按F12應該有console可以看 03/16 17:20
newList()漏寫, 程式碼已修正 還有補寫一editList(id)方法 試跑一次後看console 如下: https://imgur.com/BqsSQ1h https://imgur.com/ZAvGd4n ※ 編輯: wahahahaaa (118.161.79.20 臺灣), 03/16/2020 18:04:50
tino1991: $是jQuery, 你要先載入再拿來用 html Line:5, 6順序交換 03/16 18:56
tino1991: Js Line:10 ajax的callback fn只有res, data是多餘的? 03/16 19:01
brianwu1201: 貼 github 上來吧 03/16 20:21
wahahahaaa: Line5&6交換後可以新增清單了!!!感謝t大!! 03/16 20:47
wahahahaaa: (res, data) 改成 --> (res.data) 03/16 20:50
wahahahaaa: 可以運行了~~^^ 03/16 20:50