Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get("/testpage", function(req, res){
- var theObject = {
- id: 123,
- name: "Bob"
- }
- res.render("testpage", {objectFromNode: theObject});
- });
- var myObj= <%-JSON.stringify(objectFromNode)%>
- console.log(myObj);
- <html>
- <head>
- <title>
- </title>
- <script src="../public/js/myjavascriptfile.js"></script>
- </head>
- <body>
- <h1>Test Page</h1>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement