Magento 2 – How to Add Custom JS in Head

headjavascriptlayoutmagento2magento2-dev-beta

I have custom module. I want add file my.js in folder app\code\Xanka\Slider\view\frontend\web\js\slider\my.js.
I used code in app\code\Xanka\Slider\view\frontend\layout\default.xml

<head>
    <title>My Slideshow</title> 
    <script src="Xanka_Slider::js/slider/jquery.themepunch.plugins.min.js"/>        
</head>

is not true.

Best Answer

if want to add js file then try this

 <head>
        <link src="Xanka_Slider::js/slider/jquery.themepunch.plugins.min.js"/>
    </head>

Here instead of use using