More actions
-
- AMP components may have JavaScript under the hood, but they're carefully designed to make sure they don't cause performance degradation.
Ɓangarorin AMP kan iya samun JavaScript a ƙarƙashin su, amma an tsara su ne da kula don tabbatar da cewa ba za su jinkirtar da gudanarwar aiki ba. [1]
- AMP components may have JavaScript under the hood, but they're carefully designed to make sure they don't cause performance degradation.
-
- While custom JS is allowed in <a href="../documentation/components/reference/amp-script.md">
amp-script
</a>, and third-party JS is allowed in iframes, it cannot block rendering. For example, if third-party JS uses the <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performancedocument.write
API</a>, it does not block rendering the main page.
Duk da dai za a iya amfani da rubutun JS na kanka a cikin <a href="../documentation/components/reference/amp-script.md">amp-script
</a>, kuma za a iya amfani da JS ɗin waje a cikin iframes, ba zai iya toshe fitowar shafi ba. Misali, idan JS ɗin waje yayi amfani da <a href="http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/">super-bad-for-performance document.write API</a>, bai toshe fitowar babban shafin ba.
- While custom JS is allowed in <a href="../documentation/components/reference/amp-script.md">
-
- Third-party JS likes to use synchronous JS loading.
- They also like to
document.write
more sync scripts. - For example, if you have five ads on your page, and each of them cause three synchronous loads, each with a 1 second latency connection, you’re in 15 seconds of load time just for JS loading.
- AMP pages allow third-party JavaScript but only in sandboxed iframes.
- By restricting them to iframes, they can’t block the execution of the main page.
- Even if they trigger multiple style re-calculations, their tiny iframes have very little DOM.
Pages in category "AMP"
The following 3 pages are in this category, out of 3 total.