javascript - Jade - script not being recognized -
i have simple jade document , want import standard jquery script:
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")
which extension of
doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') body block content
the thing script not recognized! rather have 404 response, not that, nil happens @ all. doing wrong?
thanks much
p.s: i'm using express.js
controller code:
router.get("/chat",function(req,res){ res.render("chat",{title:"chat"}); });
update: added piece layout
doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') script(type="text/javascript") alert("hello!") body block content
that simple alert, , doesn't work either!
add dot literal parsing in jade. ie.
doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') script(type="text/javascript"). alert("hello!") console.log('notice dot after script tag.'); body block content
if add together dot, within block (so indented) not parsed. this:
ul li inlined text. li. 1 on its' own line, without beingness turned tag. li div div within li li. div not div, simple text within li. p added bonus, can utilize colon , next thing tag. p like, opposite of dot. p: a(href="#") clickme! p a(href="#") i'm not clickable :(
jade cool, isn't it?
edit: oops, noticed alert('hello') appendix orig question. allow me update answer.
edit 2: actually, can show rendered html (for first example) can see rendered , expect there?
javascript jquery node.js express jade
No comments:
Post a Comment