diff --git a/app/static/request.js b/app/static/request.js index e69de29..3e9cdae 100644 --- a/app/static/request.js +++ b/app/static/request.js @@ -0,0 +1,10 @@ +function request_async(){ + // 使用fetch()函数进行异步请求如果服务端响应速度极慢则不会阻塞页面 + fetch('/api/v1/test').then( + response => response.text() + ).then( + text => { + document.getElementById('fast_test_example_text').innerText = text + } + ) +}