我猜想不可能使用网络套接字,AJAX轮询可以和AMP一起使用吗? [英] I guess it's not possible to use web sockets, can AJAX polling be used with AMP?

查看:97
本文介绍了我猜想不可能使用网络套接字,AJAX轮询可以和AMP一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为页面使用AMP,该页面的某个部分当前通过websockets更新.我以为AMP无法做到这一点,因此作为后备我们可以使用AJAX轮询,还是只能是静态内容?

I am looking at using AMP for a page which has a section that gets updated via websockets currently. I assume this isn't possible with AMP, so as a fallback can we use AJAX polling, or can it only be static content?

推荐答案

您不能在AMP中使用Web套接字或AJAX轮询. 但是,使用即将发布的amp-live-list组件可能会更好地处理您的用例: https://github .com/ampproject/amphtml/issues/2762

You can't use web sockets or AJAX polling in AMP. However your use case might be better handled with the upcoming amp-live-list component: https://github.com/ampproject/amphtml/issues/2762

这篇关于我猜想不可能使用网络套接字,AJAX轮询可以和AMP一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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