2016-12-05 8 views

答えて

7

この(インラインスクリプトと外部スクリプト)を行うには、2つの方法があります。

<!doctype html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <title>Test page</title> 
    </head> 
    <body> 
    Inline script (option 1): 
    <script> 
     // your js code here 
    </script> 
    External script (option 2): 
    <script src="your-code-file.js"></script> 
    </body> 
</html> 

あなたはおそらく、この1に興味がある:

<script src="your-code-file.js"></script> 
+1

私はそれを解決しました。ありがとうございました。

4

私はCSSのファイルを含める方法を知っています。 [...]どうすれば私のjavascriptファイルを含めることができますか?

「Manage it the same way as other static files」です。次に、JavaScriptファイルを作成するのと同じ方法で、script要素を含めます。

これを試したことがある場合は、say what you tried and what happened insteadに質問を編集してください。

関連する問題