AJAX请求超时与网络处理
借助xhr的一些属性和方法:
超时设置
1 | xhr.timeout = 2000; |
超时回调
1 | xhr.ontimeout = function(){ |
网络异常回调
1 | xhr.onerror = function(){ |
1 | const xhr = new XMLHttpRequest(); |
对它们的封装: —–传送门—–
Invitation
aqing
962555446
created:15/04/2021
Welcome to Candyhome
Use this card to join the candyhome and participate in a pleasant discussion together .
Welcome to aqing's candyhome,wish you a nice day .
评论