I am creating a desktop application using web-technologies and "client-side" node.js. By using NWJS, I can load node-modules "client-side".
I would like to use something like the node's fs.readFile to load a client-side .html-file and then turn that into a jQuery-object that I can, for example, append somewhere.
I know jQuery has it's own .load()-method, but I would like to use node.js to load the file.
Edit: It is working now based on the answer by rsp
Working code:
fs.readFile('./views/main.html', function (err, html)
{
if (err)
{
throw err;
}
$('#toolview').empty().append($(html.toString()));
});