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 9010103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:22:14+00:00 2026-06-16T02:22:14+00:00

I have an error parsing an underscore template, I keep getting an error saying:

  • 0

I have an error parsing an underscore template, I keep getting an error saying:

Uncaught SyntaxError: Unexpected token else

Here is the template below: using Jade

script#viewLinksTemplate(type="text/template")
    table.table.table-condensed.table-striped
        caption Available links
        thead
            tr
                td link id
                td Name
                td View
                td Edit
                td Remove
        tbody
            {[ _.each(routes, function(route) { ]}

            tr
                td {{ route._id }}
                {[ if (typeof route.name !== 'undefined') { ]}
                td {{ route.name }}
                {[ } ]}
                {[ else { ]}
                td {{ route.stations.start.name }} - {{ route.stations.end.name }}
                {[ }; ]}
                td
                    a.btn.btn-primary(href="/route") View Route
                td
                    a.btn.btn-warning Edit Route
                td
                    a.btn.btn-danger Delete Route
            {[ }); ]}

The problem seems to be in the if/else statement. When I remove it completely the parts that are left on the template are rendered.

So, am I missing something with the syntax? All my other templates have javascript, and render correctly, except this one with the if/else.

Thanks

  • 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-16T02:22:15+00:00Added an answer on June 16, 2026 at 2:22 am

    It’s because the end of the if statement and the else are in two different evaluate tags. Merge them into one by replacing:

    {[ } ]}
    {[ else { ]}
    

    with:

    {[ } else { ]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an error: Error parsing XML:not well-formed(invaled token) in my activity_main.xml file and
I have error when I was parsing xml data. when we are converting xml
Before I begin, I have read through the following discussions: XML Parsing Error: not
I have gotten this error in the strings.xml file: error: Error parsing XML: unbound
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'
I have an error when parsing an xml document with sax parser in android.
I'm getting the error, SOAP-ERROR: Parsing Schema: can't import schema from ' http://schemas.xmlsoap.org/soap/encoding/ '
Have error ValueError: time data '2012-03-15 9:45:00 AM' does not match format '%Y-%m-%d %H:%M:%S'
I have error in line 2 and 13 in PHP 5.2, I have no
Hello i have error when i am forwarding page without parameter. that is happen

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.