Java Intro to Java Web Development with Spark Diving into Web Development Cookies

Jason Anders
Jason Anders
Treehouse Moderator 145,088 Points

Syntax question for templates...

I'm not sure if it's just my browser, but when I use {{ #if username }} with a space after the second opening brace before the pound sign, I get a 500 (Server error).

But... if I do `{{#if username }} with no space all works just fine.

Is this a syntax thing or just a picky browser? Craig Dennis

Thanks :dizzy:

1 Answer

Seth Kroger
Seth Kroger
56,369 Points

Your browser will never see the Handlebars code. It's all replaced server-side with normal HTML, much like PHP or Rails. The examples on Handlebars.js and are all a bit short on whitespace, so it's probably a syntax issue.