Im trying to add custom JS in my new theme. 
I managed to add custom css in default_head_blocks.xml
Like this:
<css src="css/customtheme.css" />
<css src="css/styles-m.css" />
<css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
<css src="css/print.css" media="print" />
Now i tried to do the same with javascript:
<script src="js/javascript.js" />
To test it i added this code in js/javascript.js:
alert('test!');
But sadly nothing. What is the corrrect way to include javascript in a custom magento 2 theme?
Thanks in advance,
-Kevin
 Qaisar Satti
 
 32.6k18 gold badges88 silver badges138 bronze badges
 
 1 Answer 1
use link
 <link src="js/javascript.js" /> 
 answered Oct 13, 2016 at 12:57
 
 
 
 Qaisar Satti 
 
 32.6k18 gold badges88 silver badges138 bronze badges
 
 - 
 Nothing still for some reason :lKevin.a– Kevin.a2016年10月13日 13:01:01 +00:00Commented Oct 13, 2016 at 13:01
- 
 did you deploy the content after thatphp bin/magento setup:static-content:deployQaisar Satti– Qaisar Satti2016年10月13日 13:01:55 +00:00Commented Oct 13, 2016 at 13:01
- 
 
default