跳到主要内容
CNode

参考node.js 开发指南的例子与遇到的问题

社区
Xxuygfbi发布于 14 年前最后回复 12 年前
654450

Object # has no method 'forEach'

查看回复

回复 (6)

L
ldl694178563#612 年前

跟我一样的亲手可以参考哦 http://www.9958.pw/post/nodejs_lesson

N
nodejser#512 年前

cnodejs bug啊,用户的输入没有进行编码就直接输出到html了。。。

X
xuygfbi#314 年前
引用 airylandforEach是Array的方法,你是对对象使用了这个方法吧。

@xuygfbi 在<% if (!user) { %>

欢迎来到 Microblog

Microblog 是一个基于 Node.js 的微博系统。

登录 立即注册

<% } else { %> <%- partial('say') %> <% } %> <%- **partial('posts',posts)** %>出的问题
X
xuygfbi#214 年前
引用 airylandforEach是Array的方法,你是对对象使用了这个方法吧。

是的 Post.get(null, function(err, posts) { if (err) { posts = []; } res.render('index', { "title": '首页', "posts": posts, });

	});
A
airyland#114 年前

forEach是Array的方法,你是对对象使用了这个方法吧。

参与回复

登录后即可参与回复。登录