Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
85
rated 0 times [  86] [ 1]  / answers: 1 / hits: 9233  / 11 Years ago, sat, december 28, 2013, 12:00:00

I'm referring the following great tutorial on MEAN stack.



Now I'm facing a template(JADE) related issue which I'm not able to resolve :(
Can you plz have a look and help me if possible.



http://www.ibm.com/developerworks/library/wa-nodejs-polling-app/



    doctype 5
html(lang='en')
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width,
initial-scale=1, user-scalable=no')
title= title
link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.1/
css/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
body
nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
div.navbar-header
a.navbar-brand(href='#/polls')= title
div.container
div


I'm getting this exception. Tried couple of varitions but couldn't resolve it yet.



Error: C:DevEnvUT3_NodeHelloWorldNodeProjectviewsindex.jade:14
12| a.navbar-brand(href='#/polls')= title
13| div.container
> 14| div

**link is self closing and should not have content.**


Thanks in adv.


More From » node.js

 Answers
6

Your problem is this line:



link(rel='stylesheet', href='/stylesheets/style.css')                


You can't see it very well on StackOverflow, but you have a bunch of whitespace after the tag.



The whitespace is shown here replaced with _:



link(rel='stylesheet', href='/stylesheets/style.css')________________


So your Jade would generate something like:



<link rel=stylesheet href=/stylesheets/style.css>________________</link>


which is not allowed, since <link> elements are not allowed to have child nodes.


[#49166] Friday, December 27, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leslijessalyng

Total Points: 650
Total Questions: 85
Total Answers: 109

Location: Croatia
Member since Mon, Sep 6, 2021
3 Years ago
leslijessalyng questions
Fri, Feb 21, 20, 00:00, 4 Years ago
Tue, Jul 30, 19, 00:00, 5 Years ago
Fri, Jul 5, 19, 00:00, 5 Years ago
Wed, Mar 13, 19, 00:00, 5 Years ago
;