Answer the question
In order to leave comments, you need to log in
How to display data from the server (node,jade)?
Good day!
I will warn you in advance that I am new to JS and everything related to it.
A little about where everything happens and what is used.
node.js/express/jade/postgresql
I get data from server like this:
var query = connection.query('SELECT * FROM table');
query.on('row', function(row, result) {
result.addRow(row);
});
query.on('end', function(result) {
data = result.rows;
console.log(data);
});
[ { id: 1,
name: "Pinky",
text: "Little story about Pinky" },
{ id: 2,
name: "Brain",
text: "They'll take over the world" } ]
Answer the question
In order to leave comments, you need to log in
I figured it out myself, sighing and watching how answers to related topics appear ..
data:
[ { id: 1,
name: "Pinky",
text: "Little story about Pinky" },
{ id: 2,
name: "Brain",
text: "They'll take over the world" } ]
each page in pages
p
h1= page.name
a= page.text
hr
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question