Defer javascript files by default
Prevent scripts blocking browser HTML parsing. The modern method instead of moving scripts to the end of the body tag as suggested in kanboard/kanboard#3829
This commit is contained in:
parent
539e2bfd6c
commit
7c0a1a5fbd
|
|
@ -21,7 +21,7 @@ class AssetHelper extends Base
|
|||
*/
|
||||
public function js($filename, $async = false)
|
||||
{
|
||||
return '<script '.($async ? 'async' : '').' type="text/javascript" src="'.$this->helper->url->dir().$filename.'?'.filemtime($filename).'"></script>';
|
||||
return '<script '.($async ? 'async' : '').' defer type="text/javascript" src="'.$this->helper->url->dir().$filename.'?'.filemtime($filename).'"></script>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue