admin管理员组文章数量:1245873
This is the error in my jade template:
Error: E:\Do\hello_express\node_notes\views\simple.jade:6
4| meta(charset="utf-8")
5| meta(name="viewport",content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no")
> 6| meta(http-equiv="X-UA-Compatible",content="IE=edge")
7| title= #{title}
8| link(rel='stylesheet',href='.2.0/css/bootstrap.min.css')
9| link(rel='stylesheet',href='stylesheets/notes.css')
unexpected text
t
My template looks like this:
html
head
meta(charset="utf-8")
meta(name="viewport",content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no")
meta(http-equiv="X-UA-Compatible",content="IE=edge")
title= #{title}
link(rel='stylesheet',href='.2.0/css/bootstrap.min.css')
link(rel='stylesheet',href='stylesheets/notes.css')
script(type='text/javascript',src='.1.1/jquery.min.js')
script(type='text/javascript',src='.2.0/js/bootstrap.min.js')
body
block content
This is the error in my jade template:
Error: E:\Do\hello_express\node_notes\views\simple.jade:6
4| meta(charset="utf-8")
5| meta(name="viewport",content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no")
> 6| meta(http-equiv="X-UA-Compatible",content="IE=edge")
7| title= #{title}
8| link(rel='stylesheet',href='http://maxcdn.bootstrapcdn./bootstrap/3.2.0/css/bootstrap.min.css')
9| link(rel='stylesheet',href='stylesheets/notes.css')
unexpected text
t
My template looks like this:
html
head
meta(charset="utf-8")
meta(name="viewport",content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no")
meta(http-equiv="X-UA-Compatible",content="IE=edge")
title= #{title}
link(rel='stylesheet',href='http://maxcdn.bootstrapcdn./bootstrap/3.2.0/css/bootstrap.min.css')
link(rel='stylesheet',href='stylesheets/notes.css')
script(type='text/javascript',src='http://cdnjs.cloudflare./ajax/libs/jquery/2.1.1/jquery.min.js')
script(type='text/javascript',src='http://maxcdn.bootstrapcdn./bootstrap/3.2.0/js/bootstrap.min.js')
body
block content
Share
Improve this question
edited Jul 21, 2014 at 16:48
Scimonster
33.4k10 gold badges79 silver badges91 bronze badges
asked Jul 21, 2014 at 16:41
vamsiampoluvamsiampolu
6,63220 gold badges89 silver badges193 bronze badges
1
- 1 maybe time to change the accepted answer? – Avraham Commented Aug 30, 2017 at 5:04
2 Answers
Reset to default 10This error is due to blank-space characters at the end of the line.
The error would be due to the title
element rather than the meta
being pointed to.
For it, you'll either want to use tag=
or #{...}
, but not both on the same element.
title= title
title #{title}
The 1st form expects the content that follows the =
to be a valid JavaScript expression, which #{...}
isn't currently considered.
The 2nd form instead treats the content as plain text, with the exception of #{...}
sections that Jade allows for interpolating/inserting the results of code.
本文标签: javascriptError unexpected text when using jadeStack Overflow
版权声明:本文标题:javascript - Error unexpected text when using jade - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740187671a2238512.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论