如何解决 PHP 网站测试中的每个 AMP 错误

How to solve every AMP errors in PHP website testing

AMP 测试只剩下 3 个错误类型

Custom JavaScript is not allowed. (23 instances)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> 

The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value. (10 instances)

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" rel="stylesheet"> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />

The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? (50 instances)

For event `<img>` tag it is showing error. I have even used alt, width, height attributes properly.

我无法解决这些错误。请有人告诉我如何解决这个问题。

也无法在 Internet Explorer 中打开网站。

我正在使用 https://search.google.com/test/amp

AMP 有您必须遵守的严格规则。

你不能只加载js。您需要使用允许的脚本和组件:https://amp.dev/documentation/components/

不能使用<img>标签,需要使用<amp-img>

您不能以常规方式加载字体,您需要使用 amp-font:https://amp.dev/documentation/components/amp-font/?format=websites

另一位社区成员已告知您,您的网站几乎没有错误导致这些错误。您说您的站点无法在 Internet Explorer 浏览器中打开。

如果我们谈论 AMP 浏览器支持,可以在他们的网站上找到此信息。

In general we support the latest two versions of major browsers like Chrome, Firefox, Edge, Safari, Opera and UC Browser. We support desktop, phone, tablet and the web view version of these respective browsers.

Beyond that, the core AMP library and built-in elements should aim for very wide browser support and we accept fixes for all browsers with market share greater than 1 percent.

In particular, we try to maintain "it might not be perfect but isn't broken"-support for IE 11, iOS 8, the Android 4.0 system browser and Chrome 41.

参考:AMP Supported Browsers

我建议您尝试修复现有的错误,然后尝试在 IE 浏览器中检查该网站,看看它是否有效。

如果问题仍然存在,那么我建议您就该问题联系 AMP 支持人员。