问题描述:

<script type="text/javascript">

(function() {

var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;

po.src = "https://apis.google.com/js/plusone.js?publisherid=112917099095075652323";

var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);

})();

</script>

<script async src="https://apis.google.com/js/plusone.js?publisherid=112917099095075652323"></script>

Id like to start switching over scripts that are loaded from third parties into the latter syntax. Curious as if the type attribute is even needed. Looking to load all these scripts asynchronously. Thoughts?

网友答案:

In your first part of codes, you are actually just creating the same HTTP tag. I think it should be checkable by Chrome or FireFox F12 since the codes there (Chrome F12 - Elements) are processed.

相关阅读:
Top