2017-11-03 13 views
0

私の問題はjavascriptを動作させることではありません。 私のJavaScriptファイルは、公開/ JavaScriptのnodejsでjavascriptファイルを接続する方法

app.js

app.use(express.static(path.join(__dirname, 'public'))); 

ビュー/ layout.pug

doctype html 
html 
    head 
    title Sunghee 
    meta(charset='utf-8') 
    meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no') 
    link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css', integrity='sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M', crossorigin='anonymous') 
    link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css') 
    script(src='https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity='sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin='anonymous') 
    script(src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js', integrity='sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4', crossorigin='anonymous') 
    script(src='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js', integrity='sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1', crossorigin='anonymous') 
    //- script(src='https://unpkg.com/[email protected]/dist/jquery.js') 
    script(src='https://code.jquery.com/jquery-3.2.1.min.js') 
    link(rel='stylesheet', type='text/css', href='/stylesheets/layout.css') 
    script(src='/javascripsts/layout.js') 
    block css  
    block script 

ビュー/イベント/ new.pug

であります
extends ../layout 

block css 
    link(rel='stylesheet' type='text/css' href='/stylesheets/events/new.min.css') 

block script 
    script(src='/javascripts/events/new.js') 

公開/ javascripsts /イベント/ new.js

$(function(){ 
    tinymce.init({ 
    seletor: '#mytextarea' 
    }); 
}); 

ないすべてのJavaScriptファイルのは、このファイルだけでなく、働きます。 package.jsonの "dependencies"に"jquery": "^3.2.1"があります どうすればよいですか?

答えて

0

Mistypings?

スクリプト(SRC = '/ javascrip TS/layout.js')

:あなたの ビュー/ layout.pugオン
関連する問題