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,