From f0dd72d350bbd7b0dd943d8fbcb897c75c04d1f7 Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Thu, 14 Apr 2022 22:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86js=E9=9D=99=E6=80=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/request.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 + } + ) +}