Hi,
I have created module using module.exports and fetched sql data using ( var
sql = require('mssql');var fs = require('fs');var ejs = require('ejs');
but i am not able to pass returned html data or returned table in html page
to use in javascript.
To render inside module i used all these:-
var compiled = ejs.compile(fs.readFileSync(__dirname + '/myproduct.ejs',
'utf8'));
var html = compiled({ text : myalldata });
res.end(ejs.render(html));
--->>> This only load sql data to new page not in script.
app.render(__dirname+'/myproduct.html', { result: recordset }).
res.sendFile(__dirname+'/myproduct.html');
--->>> That also not works.
Please help or provide valid guide that would be reliable.
Thanks,
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/cc480488-2d6c-42c3-88b4-692c528ed5be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.