简体   繁体   中英

Entering variables in res.write()

 Object.keys(result).forEach(function(key) { var row = result[key]; var firstName=row.fname; var lastName=row.lname; var bloodGroup=row.bloodgroup; var state=row.state; var city=row.city; var address=row.address; var pincode=row.pincode; var job=row.job; var occupation=row.occupation; }); }; }); res.write("<!DOCTYPE HTML><html><head>'city'</head></html>");

So I want to insert any variable inside this html code in the res.write(), whats the right way to do it?

res.write("<!DOCTYPE HTML><html><head>"+city+"</head></html>");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM