scatterprose
New Member
I created a main menu (navigation) using Node.js. I used Jade as the template engine under express. The menu is created in pure HTML & CSS. Node.js is intended to provide the menu via a URL. I want to include this menu into an existing web application and it should be provided by Node.js. I thought about something like the following in my website.html:\[code\]<body> <!-- begin: include main menu --> <script type="text/javascript" src="http://127.0.0.1:3000/menu"></script> <!-- end: include main menu --> the rest of the application/website ...</body>\[/code\]I got it to work pass some HTML to my website using the following code in my routing mechanism, but I think this is really dirty done:\[code\]res.send("document.write('SOME_HTML_GOES_HERE')");\[/code\]But I need to pass the views/menu.jade as HTML snippet back to the website.html. I already returned whole HTML sites with:\[code\]res.render('index', { title: 'Express & Jade' });\[/code\]How can I get that the menu is loaded in a non Node.js application delivered by Node using a template mechanism?