index.jade文件:
doctype html
html
head
meta(charset='utf-8')
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(type='text/javascript', src='/javascripts/jquery-1.10.2.js')
script(type='text/javascript', src='/javascripts/index.js')
body
button(onclick='test()')="点击"
index.js文件
function test(){
console.log('test')
}
为什么这样写是报错test未定义的呢?