Reputation: 1
I am trying to retrieve data from database and display them on screen(front page ), using express, ejs, and javascript.
Data from database is displayed as a json in console, but after saving in object myobject
and displaying in console, it displays as a object myobjectnew[object Object]
,
and passing to ejs page using module.exports=myobject
;
In ejs file I used
w3.getHttpObject("event.js", myFunction);
function myFunction(myobject)
w3.displayObject("id01",myobject);
<table id=id01>
<td> fisrtname{{firstname}}</td>
but that data is not transfered into ejs file, and output is not displayed, can someone please answer for this question?
Upvotes: 0
Views: 138
Reputation: 138267
Cause EJS use another notation, your syntax is for handlebars. For EJS it is:
<td> firstname: <%= firstname %></td>
Upvotes: 1