我有一个表单提交数据并等待json响应,但是当表单尝试将responseText解析为JSON时,PHP上的一些错误/警告/通知会引发javascript异常.
有没有办法在表单之前捕获错误或执行我的验证?
我尝试重写Ext.JSON.decode,但由于某种原因,即使控制台错误显示如下,表单也不使用该定义
Uncaught Ext.JSON.decode(): You're trying to decode an invalid JSON String: my wrong json test!! ext-all.js:21
Ext.Error.Ext.extend.statics.raise ext-all.js:21
Ext.JSON.me.decode ext-all.js:21 <-- why Ext.JSON.[me].decode?
Ext.define.handleResponse ext-all.js:21
Ext.define.processResponse ext-all.js:21
Ext.define.onSuccess ext-all.js:21
Ext.apply.callback ext-all.js:21
Ext.define.onComplete ext-all.js:21
Ext.define.onStateChange ext-all.js:21
(anonymous function)
Run Code Online (Sandbox Code Playgroud)
任何的想法?提前致谢.