I am using Jade framework as frontend with Nodejs & express for backend
so when I am rendering a view with data i can't access these data using JQuery
below my service from Nodejs that renders a view with simple data = x
router.get('/test',function (req,res,next) { res.render('test',{data : 'x'}); }); so the test page will show without any problem, what am trying to do is to read the rendered data using Jquery methods
footer .pull-right | Gentelella - Bootstrap Admin Template by a(href='https://colorlib.com') Colorlib .clearfix // /footer content // jQuery script(src='/vendors/jquery/dist/jquery.min.js') alert(data) // no alert or action happen but the error said (unknown variable of data)
Moreover, I can read it from jade itself
any suggestions?
thank you