Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:05:10+00:00 2026-06-01T16:05:10+00:00

This question is related to using Jade templates with Express.js . I know that

  • 0

This question is related to using Jade templates with Express.js.

I know that when I write layout.jade that contains:

!!!
html
    body != body
        header
            h1 My header

When I call res.render('index') then my actual template is rendered to beginning of the body.

My question is this: what does != body mean and how Jade/Express use that to determine the placement for my template inside the layout? I know that if I change != body inside another element then the actual view is rendered there instead. Does anyone know where this feature is documented?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:05:11+00:00Added an answer on June 1, 2026 at 4:05 pm

    I quote, from Jade’s documentation/guide:

    Code buffered by = is escaped by default for security, however to output unescaped return values you may use !=:

    p!= aVarContainingMoreHTML

    When using res.render('index') the rendered contents of index.jade (in your case) will be passed as a local variable to your layout file (layout.jade). The local variable is available as body. However, if we simply output the body local variable, it would be escaped (special characters will be encoded). Thus, by using !=, the contents of body will be outputted unescaped.

    Check out: http://expressjs.com/guide.html#view-rendering

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is related to the this . I'm using the following to extract
This question is related to Hibernate using JPA (annotated Entities) and liquibase . I
This question is related to a similar case, namely Removing inline styles using php
I don't know is this question more related to mathematics or programming and I'm
I have seen this question and a number of blog posts related to using
This question is related to a iOS project written in ObjectiveC that makes use
I have looked around but cannot find anything that answered this particular question related
This question is related to UITableView issue when using separate delegate/dataSource , though I
This question is related to c#.The scenario is that when i click the button
This question is related to another question that I posted on SO earlier How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.