【问题标题】:NetworkError: Failed to execute 'send' on 'XMLHttpRequest' with Chrome Browser - Ext JSNetworkError:无法使用 Chrome 浏览器在“XMLHttpRequest”上执行“发送”-Ext JS
【发布时间】:2020-10-14 16:18:40
【问题描述】:

仅通过 Chrome 浏览器从应用程序注销时出现错误。

Chrome 浏览器版本 86.0

Blocked alert('Uncaught NetworkError: Failed to execute 'send' on “XMLHttpRequest”:加载失败 'https://host-name/web/base/logout?id=40dee37f-cf1d-40f9-b01d-2a414d446a77&tenant=ABC&isFrameMode=true&_dc=1602665141328': 页面关闭中的同步 XHR。看 https://www.chromestatus.com/feature/4664843055398912 了解更多 详细信息.. 行:1. 网址: https://hostname/web/base/abc/app.js?_dc=20161213063112') 期间 卸载。

用于退出应用程序的代码:

var vRequest = { url: vUrl, async: false },
Ext.Ajax.request(vRequest);

已尝试将 async 属性值从 false 更改为 true,但现在请求状态在开发者工具中显示为已取消。

【问题讨论】:

  • 有人可以检查和建议这个问题吗?提前致谢。

标签: ajax google-chrome extjs xmlhttprequest


【解决方案1】:

问题不在于 ajax 调用。问题是调用是根据您遇到的错误,在不再允许的事件期间发生的,beforeunload、unload、pagehide、visibilitychange...等

Here are some alternate ways to return data to the server on logout.

【讨论】:

  • 感谢您的建议......!我尝试了以下不起作用的解决方法,并在开发人员工具中显示 Chrome XHR/fetch 请求已取消。 1) 将 async 属性值更改为 true。 2) Fetch API 和 Navigator.sendBeacon API 敬请指教。
猜你喜欢
  • 2015-12-28
  • 1970-01-01
  • 1970-01-01
  • 2018-12-07
  • 1970-01-01
  • 2016-12-03
  • 2018-12-29
  • 2019-04-23
  • 1970-01-01
相关资源
最近更新 更多