0
我正在使用express js。我想将变量“resultat”的内容传递给客户端,并将其放入一个JavaScript变量以用于ejs页面。 这个代码是在app.js如何将变量内容传递给客户端?
var fs = require('fs');// File System Module
var xml2js = require('xml2js'); // XML2JS Module
var parser = new xml2js.Parser(); // Creating XML to JSON parser object
// Reading and Parsing the file
fs.readFile('views/xmlfile.xml', function(err, data) {
parser.parseString(data, function (err, resultat) {
console.log(resultat);
console.log('Done');
});
});
the content of the variable "resultat" is shown in the console
您的快递服务器在哪里? – Bergi
可以给我你的邮件解决问题 – Maki
不,只是[编辑]你的问题,包括细节 – Bergi