worker-dom
worker-dom copied to clipboard
Add support for HTMLFormElement.submit()
According to https://github.com/ampproject/worker-dom/blob/master/web_compat_table.md
HTMLFormElement.submit() is not yet supported.
Would be great to add support for that, this way we could do things like:
window.setInterval( () => {
document.getElementyById('my-form').submit();
}, 3000 );
And if that amp-form
is a GET form you have the possibility of getting data coming back from server every X seconds.
More info: https://stackoverflow.com/questions/57571092/how-to-use-amp-script-to-submit-a-form-and-get-data-from-server-every-x-seconds/57575347#57575347
Thanks in advance.
Hi @mbelchin trying to understand the user need here. Are you trying to implement something like amp-live-list here?
https://amp.dev/documentation/examples/components/amp-live-list/
Hi @nainar,
the idea is similar but amp-live-list does not work for our use case, because of two reasons:
- the period of time for polling is to high, we should have something between 1sec to 3 secs maximum.
- We don't want to tap, click or any other type of event in order to get the updates.
Imagine a chat: you send messages and you expect to receive new messages in from the other end every X seconds.
Regards