node.js - How to edit jade image field from within Node/Express? -
i want display image on webpage on basis of user enters in form. have form defined in abc.jade, , in abc.js store form, , generate image's url , store in variable map_img on basis of form. how set image's source in jade point map_img url?
abc.js:
sales.save(); markers = [{ 'location': sales.location }] var gm = require('googlemaps'); var map_img = gm.staticmap(sales.location, 16, '500x400', false, false, markers);
in general, best way manipulate fields in html/jade document node/express?
im not sure if question right...
there severals ways send data. described here: http://jade-lang.com/reference/
i use #{img_map} or in case have pure html better use !{img_map_html_desc}.
also, alternative variant, create #temp div, send data there. on front end js(on window.onload) can data , store variable. don't forget clear #temp div after dont need anymore. once i've used side front-end js module , couldnt find better sollution, this. cause module waited window.onload, , started load itself...