- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 220字
- 2021-07-08 10:03:57
Validating your AMP pages
We'll be seeing more about validation in the next chapter. For now, you just need to know that your AMP pages must validate before they will be added to the AMP Cache. The easiest way to check if your page is valid is to append #development=1 to the URL of the page in the browser address bar, and open up the Developer Tools (Cmd + Opt + I on Mac, Ctrl + Shift + I on Windows), and navigate to the Console tab. You'll then get a report for your page, indicating if it's valid. The page we just created should validate as follows:

If it's not valid, you'll get some helpful error messages for any failures. To see this in action, remove the line that begins with <link rel="canonical"...> from your code and reload the page with #development=1 at the end of the URL. This time the validator informs us that the mandatory canonical tag is missing:

You'll need to add that line back in before the page validates again. But even if it doesn't validate, it will still render in most modern web browsers, since AMP is HTML-based. You will lose out on the benefits of the AMP Cache however.
- C語言程序設(shè)計(jì)(第3版)
- SoapUI Cookbook
- Mastering QGIS
- Wireshark Network Security
- C語言從入門到精通(第4版)
- 可解釋機(jī)器學(xué)習(xí):模型、方法與實(shí)踐
- Java:High-Performance Apps with Java 9
- ASP.NET開發(fā)與應(yīng)用教程
- 好好學(xué)Java:從零基礎(chǔ)到項(xiàng)目實(shí)戰(zhàn)
- Machine Learning in Java
- PHP 8從入門到精通(視頻教學(xué)版)
- 計(jì)算機(jī)組裝與維護(hù)(第二版)
- JavaWeb從入門到精通(視頻實(shí)戰(zhàn)版)
- 移動(dòng)智能系統(tǒng)測試原理與實(shí)踐
- Java無難事:詳解Java編程核心思想與技術(shù)