extjs - 无法从“XMLHttpRequest”读取“responseText”属性
问题描述
使用以下存储从远程服务器加载列表
var store = Ext.create('Ext.data.Store', {
model: 'MyAppName.view.home.OrderListViewModel',
groupField: 'customer',
proxy: {
type: 'ajax',
url: 'ordersList.php',
reader: {
type: 'json',
rootProperty: 'orders',
totalProperty: 'total'
}
},
autoLoad: {
params: {},
callback: function (records, options, success) {
if (success) {
alert('here I am');
}
}
}
});
它正确加载了列表,但查看 Chrome 控制台会出现错误
Uncaught DOMException: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'json').
Nad 看着萤火虫就像仍在尝试加载列表。
GET fabricList.php?_dc=1579631906478&page=1&start=0&limit=25
Params Headers Response
store:Ext.create('Ext.data.Store',{})
我在程序中使用的每一个都发生了同样的情况。我正在使用 ExtJS 版本 7.0.0.40 我将不胜感激在这件事上的任何帮助。谢谢
解决方案
可能此错误表明从您的端点fabricList.php
MDN返回的数据格式不正确。请发布从返回的数据fabricList.php
并在此处检查Content-Type
标题以作为响应
推荐阅读
- reactjs - 如何将 useEffect 重构为 onlick 函数
- r - 如何在 R 中写出这个总和?
- javascript - 为什么我的返回 row[0] === userId.matches(userId); 什么都不显示?
- wso2 - 使用 Oauth2 和 SOAP 创建服务提供者
- discord.js - 使用 .then() 向 1 个频道发送 2 条消息
- python - 如何在 Python 中的某个起点将某些十六进制值放入数组中
- discord - 检查消息是否有 7 个字母,然后发送到频道
- python - 使用 genfromtxt() 和转换器导入 csv
- c# - 没有按钮的弹出窗口 Xamarin.Forms
- c++ - Azure Function 项目在本地构建和部署,但不是来自 azure dev ops 管道