I'm having trouble with a variable (config) declared in a jade template file (index.jade) that isn't passed to a javascript file, which then makes my javascript crash. Here is the file (views/index.jade): h1 #{title} script(src='./soc...
I'm trying to pass an object with circular references from node.js server to client-side javascript. Server (node.js): var object = { circular: object } //.... app.get('/', function(req, res){ res.render('index.jade', {o...
When I send a JSON string to a jade file for rending I'm only able to print out the string in it's entirety but not by it's elements. How do I print out specific elements or loop through the JSON string? app.js: var http = require(...
i want to implement a google map based on its api. i want to add a path based on coordinates to it. therefore i get my coordinates from my model and want to iterate over the object to fille the map with this points. in my jade template i include the...
I've got a node.js express server running with the Jade template engine. I've got a layout jade file which imports the body of individual views like so: !!! html head title= title || 'Title not set.' body #...
How do I get jade to render the checked attribute of a checkbox based on a conditional? Like these two versions of the HTML checkbox tag: This seems to be the ONLY valid version of unchecked: > <input type="checkbox" name="vehic...
I have basic express js application with following route: router.get('/', function(req, res){ res.render('login'); }); It works fine - after logging into main page on my localhost, html from login.pug is nicely rendered...
Is there a way to pass an object of data/aria attributes to an element? I've tried: div(data={foo:'bar'}) div(data={foo='bar'}) div&attributes({aria:{foo:'bar'}}) But none of these output the desired attribute no...
I have a basic Express server: // server.js: var Express = require('express'); app = Express.createServer(); app.configure(function(){ app.set('views', Path.join(__dirname, 'views')); app.set('view engine', 'j...
I'm having difficulty getting a button to execute a javascript function when it is clicked, below is my jade file extends layout block content - var something = function() { - console.log('something') - } button(onclick='#...
©2020 All rights reserved.