在AMP中可以嵌入AJAX吗? [英] Is AJAX to load embeds possible in AMP?

查看:72
本文介绍了在AMP中可以嵌入AJAX吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速问题:是否可以动态加载类似内容

 < amp-twitterdata-tweetid ="611193269532295168"layout =回应"> 

通过 AJAX 转化为 AMP 文章?

解决方案

AFAIK,但是不可能AMP-

amp-live-list 组件增加了支持用于在源文档中提供新内容时将实时更新发布到AMP页面.这对于实施实时博客非常有用.

换句话说,AMP运行时将轮询服务器以获取对原始文档的更新,从而获取自身.服务器可以返回整个AMP页面 AJAX轮询可以与AMP一起使用?讨论如何动态加载AMP页面的更新.

希望这会有所帮助.

Quick question: Is it possible to dynamically load content like

<amp-twitter
  data-tweetid="611193269532295168"
  layout="responsive">

via AJAX into an AMP article?

解决方案

AFAIK, it is not possible but AMP - LIVE-UPDATING AMPS

a new AMP component that updates page content dynamically without additional navigation or reload: readers looking at an earlier version of the page will simply see new updates as they come in.

The amp-live-list component adds support for publishing live updates to AMP pages as new content becomes available in the source document. This works great for implementing live blogs.

In other words, the AMP runtime will poll the server for updates to the origin document, fetching itself. The server can returns the entire AMP page or parts of it, and the runtime updates the page in-place seamlessly.

You can also check a related SO question can AJAX polling be used with AMP? that discusses how to dynamically load updates for the AMP pages.

Hope this helps.

这篇关于在AMP中可以嵌入AJAX吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆