let xhr = new XMLHttpRequest(); let data = JSON.stringify({ //some data... }); xhr.open('POST', '/users'); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(data); let time; time = JSON.stringify({ us: true, }); setInterval(() => {xhr.send(time);}, 5000);錯誤:未捕獲的 DOMException:無法在“XMLHttpRequest”上執(zhí)行“發(fā)送”:對象的狀態(tài)必須是 OPENED
如何重用 XMLHttpRequest?
溫溫醬
2022-07-08 18:34:14