0

i'm having some troubles with jade and express. So this is the serder side:

router.get('/login', function (req, res) {
   res.status(200)
   res.render('login',{title:'login'})
   res.end()
});

This is my jade:

doctype html
html(lang='en')
  head

    meta(charset='UTF-8')
    meta(name='viewport', content='width=device-width')
    title= #{title}
    block css
      link(rel='stylesheet', href='/css/style.css')
    block js
        //script(src='../public/js/')

        script(src='http://localhost:35729/livereload.js')
  body
    block content

And, of course, these are my errors:

  > 7|     title= #{title}
    8|     block css
    9|       link(rel='stylesheet', href='/css/style.css')
    10|     block js

Unexpected token ILLEGAL
    at Function (native)
    at assertExpression (/Users/VeaVictis/iGym/node_modules/jade/lib/lexer.js:30:3)
    at Object.Lexer.code (/Users/VeaVictis/iGym/node_modules/jade/lib/lexer.js:584:23)

and a lot more after but i don't think that they will be usefull. Thank you in advance to everyone. I take this opportunity to wish you a merry xMas

1 Answer 1

2

Try removing the = sign after title

It should be

title #{title}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.