In Google's PageSpeed reports that there are some Blocking Javascript required to be async. From this article I knew that I have to place async attribute to my scripts tag:
<script async src="http://third-party.com/resource.js"></script>
In cakePHP, I don't able to achieve this exactly, I just able to get:
<script async="async" src="http://third-party.com/resource.js"></script>
Using the Html's script method as follows:
$html->script(array('jsfile1', 'jsfile2'), array('async' => 'async'));
I tried array('async')
but it prints out 0='0' in the script tag
How could I make it print just async
in the script tag. Also, how could I make it available in the link tag of css too?
Notice: I use CakePHP 1.3x