玉字不被识别
Jade - script not being recognized
本文关键字:识别 更新时间:2023-09-26
我有一个非常简单的jade文档,我想导入标准的jQuery脚本:
extends layout
block content
h1 #{title}
ul#messages
form#formAddUser(name="adduser",method="post",action="")
input#m(type="text", name="message")
button#btnSubmit(type="submit") submit
script(src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js")
是
的扩展doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
问题是,脚本甚至不被识别!我宁愿得到404响应,但即便如此,什么也没有发生。我做错了什么?
Thanks very much
p。S:我正在使用express.js
控制器代码:router.get("/chat",function(req,res){
res.render("chat",{title:"Chat"});
});
更新:我在布局中添加了一块
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(type="text/javascript")
alert("hello!")
body
block content
这个简单的警报,它也不起作用!
在jade中添加一个点用于文本解析。Ie .
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(type="text/javascript").
alert("hello!")
console.log('Notice the dot after the script tag.');
body
block content
如果你添加一个点,任何在块(因此缩进)将不会被解析。这样的:
ul
li This is inlined text.
li.
But this one is on its' own line, without the But being turned into a tag.
li
div this is a div inside a li
li.
div this is not a div, simple text inside a li.
p For added bonus, you can also use a colon and the next thing is also a tag.
p like, opposite of the dot.
p: a(href="#") Clickme!
p a(href="#") I'm not clickable :(
翡翠很酷,不是吗?
EDIT:哎呀,刚刚注意到警报('hello')只是您原始问题的附录。让我更新一下答案。
编辑2:实际上,你可以显示你渲染的HTML(第一个例子),所以我可以看到什么是实际渲染和你期望在那里?
相关文章:
- 如何识别我的网站中的慢速设备
- Google/html5语音识别JavaScript SDK Chrome网络工具包SpeechRecognition
- AngularJS指令只识别双向绑定类型
- php脚本中无法识别ajax传递的值
- 识别没有ID或特定属性的对象
- JavaScript无法识别图像
- 识别由不同数量的项组成的json对象
- 无法识别从php创建的Js函数
- 错误:语法错误,无法识别的表达式:不支持的伪:无效/RectJS/Unit Testing
- 函数无法识别初始化的变量
- 具有带大括号的字符串时无法识别的表达式
- 在Fiddler JavaScript中识别POST请求
- 未捕获错误:语法错误,无法识别的表达式:input[@type=submit]
- javascript正则表达式来识别所有特殊字符
- 确定(识别)dc.js图表类型
- Ionic应用程序无法识别android手机中的语音
- node.js可以识别字符模式,但不能识别数字模式
- 数据切换=“;按钮”;在JavaScript中无法识别引导程序单选按钮
- 通过单击事件识别画布上的对象
- 使用jQuery+Javascript识别一个空文本节点