作者wahahahaaa (hah)
看板Ajax
标题[问题] 使用express建立专案但无法运行
时间Mon Mar 16 15:31:59 2020
请教版上高手 近期跟着'一次搞懂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://webptt.com/cn.aspx?n=bbs/Ajax/M.1584343921.A.EAA.html
※ 编辑: wahahahaaa (118.161.79.20 台湾), 03/16/2020 15:33:17
1F:推 icydream: 不能正常执行的错误讯息是? 03/16 16:42
想要新增一笔待办清单 输入完内容 按确认 网页没有反应
https://imgur.com/cuFHjPG
https://imgur.com/jWTWfUl
※ 编辑: wahahahaaa (118.161.79.20 台湾), 03/16/2020 17:00:23
2F:→ tino1991: js Line:10, 21 的newList() 在哪? 03/16 17:17
3F:→ 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
4F:→ tino1991: $是jQuery, 你要先载入再拿来用 html Line:5, 6顺序交换 03/16 18:56
5F:→ tino1991: Js Line:10 ajax的callback fn只有res, data是多余的? 03/16 19:01
6F:→ brianwu1201: 贴 github 上来吧 03/16 20:21
7F:→ wahahahaaa: Line5&6交换後可以新增清单了!!!感谢t大!! 03/16 20:47
8F:→ wahahahaaa: (res, data) 改成 --> (res.data) 03/16 20:50
9F:→ wahahahaaa: 可以运行了~~^^ 03/16 20:50