Defer error
-
I have resolved my problem, but wanted to make you aware of it in case it could help your further development.
After updating to the latest version 0.7.0, we began seeing sitewide errors in the AMP validator related to
defer
being added to<script type='text/javascript' async="async" src='https://cdn.ampproject.org/v0.js'>
This was caused by code I have in functions.php to add defer to jQuery.
function add_async_attribute($tag, $handle) { if ( 'jquery' == $handle ) return $tag; return str_replace( ' src', ' defer="defer" src', $tag ); }
I would think that the v2.js plugin should not qualify as having the jquery handle. The fix was to change
defer="defer"
toasync="async"
.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Defer error’ is closed to new replies.