我有我的 Google 自定义搜索引擎 (GCSE) 代码:
<script>
(function() {
var cx = '008589157460623253837:mhsjluzrngo';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
Run Code Online (Sandbox Code Playgroud)
但是,我的 Accelerated Mobile Pages (AMP) 站点不允许我向其中添加 JavaScript,并且我没有看到任何允许将 GCSE 嵌入到 AMP 站点的 AMP 组件。
如何在不违反 AMP 合规性的情况下在我的网站上获得 GCSE?
谢谢
amp-html ×1