我目前正在尝试使用此链接https://davidwalsh.name/javascript-polling(以及许多其他链接)向我的应用程序添加轮询。
我可以访问以下已经实现的 api:
client.get('url')
// returns Promise with result of getting result from url
// for the application I am working on,
// the URL returns json that looks like the following
// {status: DONE or IN PROGRESS, other values...}
// when status is DONE other values are what I will use in the application
client.post('url', {data: passAnyDataHere})
// sends a post request with result of sending data to url
// starts the specific job
Run Code Online (Sandbox Code Playgroud)
我遇到的问题之一是,在尝试调整我上面链接的 JavaScript 轮询代码时,当我发现状态为 …