I tested my page with an optimizer, and it suggests me to use the async attribute for all CDN sources that I use, like for instance:
<script async src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
To run any script I use:
(function(){
})();
I also have JavaScript code in inline script tags that reference such libraries. However, when I add async as above, I get an error in the following script:
<script>
(function(){
jQuery.foundation();
ReactDOM.render(<App />,document.querySelector('#app'));
})();
</script>
I've tried adding async to this script tag as well, but it still doesn't work. I still get an error that the library loaded with the async attribute doesn't exist.