Hello everyone!
In some cases
We must cancel some JS
For example: chosen.jquery.min.js

This often affects some templates JS
Show cause abnormal or incorrect
So today I am particularly modifying the way I used to share

//The following code is usually written in the template index.php inside
$document = JFactory::getDocument();//Call Document Type
$headData = $document->getHeadData();//Obtain current HeadData

$scripts = $headData['scripts'];//HeadData array There scripts. Place to load JS

$newScripts = array();//JS loaded replace the original array
$noJs = array();//Which side of the place you want to remove some JS
$noJs[] = 'chosen.jquery.min.js';

foreach ($scripts as $js=>$v)//JS array loop
    $goJs = TRUE;
    foreach ($noJs as $findJs)//JS array to remove
        if (strpos($js, $findJs))//if true
            $goJs = FALSE;
    if ($goJs)//if pass
        $newScripts[$js] = $v;//put in new array

$headData['scripts'] = $newScripts;//Replace JS Array

//in css
$styleSheets = $headData['styleSheets'];
unset($styleSheets['/media/system/css/modal.css']);//use unset
$headData['styleSheets'] = $styleSheets;//replace array

//Here you can directly modify the script headData
$headData['script']['text/javascript'] = str_replace("jQuery('select').chosen","jQuery('selectNone').chosen",$headData['script']['text/javascript']);

//put in headdata

Of course
My side of the modified method is not necessarily correct
Mainly for under certain circumstances
Need to modify the default JS loaded joomla3
Even jquery load

For your reference