不推荐使用主线程上的同步XMLHttpRequest

  • 我试图从我的ext js 4.1应用程序中删除以下警告。 主线程上的同步XMLHttpRequest由于其对最终用户体验的不利影响而被弃用。 如需更多帮助,请访问http://xhr.spec.whatwg.org/ 。

    • 所以我做了一些研究,在ext js中找到了以下链接。

ExtJS 4.2 – “Sychronous XMLHttpRequest”警告的可能原因?

  • 因为他们要求删除Ext.Loader并用ext.require替换它。
  • 所以我有三行包含ext.loader我需要像这样替换ext.require
Ext.Loader.setConfig({enabled:true}); Ext.Loader.setPath('here-aps.plugin', here-ext4Path.replace('/scripts/here-aps-extjs4', '/js/here-aps/plugin')); Ext.Loader.setPath('here-aps', here-ext4Path + '/here-aps'); 

转换成

 Ext.require.setConfig({enabled:true}); Ext.require.setPath('here-aps.plugin', here-ext4Path.replace('/scripts/here-aps-extjs4', '/js/here-aps/plugin')); Ext.require.setPath('here-aps', here-ext4Path + '/here-aps');