So, this it my code:

extends layout
doctype html
html(lang="en")
head
    meta(charset="UTF-8")
    title = My Page Title
    script(type="text/javascript",src="../javascripts/jquery-git2.js")
    script(type="text/javascript").
        console.log("this should work, right?")
    body
        block content
            h1= title
            div !{article}

Strangely enough, the scripts run and include just fine when I put them in the body, but I want them in the header. Am I missing something? Thanks in advance! I'm totally stuck on this one.

有帮助吗?

解决方案 2

Just figured it out! I'm new to Jade and didn't know that the head was taken care of by the layout.jade file. Once I placed the script references in the layout.jade file under the head where they belong, everything worked fine. Thanks for your help and suggestions everyone!

其他提示

Your template generates nested <script> tags.

Try unindenting the second script:

script(type="text/javascript",src="../javascripts/jquery-git2.js")
script(type="text/javascript").
    console.log("this should work, right?")
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top