简体   繁体   English

EmberData unloadAll在IE8上不起作用。 适用于Chrome / FireFox

[英]EmberData unloadAll doesn't work on IE8. Works on Chrome/FireFox

Thanks in advance for the help ! 先谢谢您的帮助 !

I am having a problem refreshing my model on IE8. 我在刷新IE8上的模型时遇到问题。 (Works on Chrome Chrome and Firefox) I run this code to refresh my model with a request to the database using my adapter. (适用于Chrome,Chrome和Firefox)我运行此代码,以使用适配器向数据库发出请求来刷新模型。 Through this command I am unloading the data of the model and reloading it again to display it to the user: 通过此命令,我正在卸载模型的数据,然后再次重新加载以将其显示给用户:

var type = self.controller.get('model').type;

this.controller.get('model').get('store').unloadAll(type);
this.controller.get('model').get('store').fetchAll(type);

No Javascript errors. 没有Javascript错误。 I have looked for a solution but not a clue about it. 我一直在寻找解决方案,但没有线索。 Any idea? 任何想法?

Thanks ! 谢谢 !

EDIT : I got a solution. 编辑:我有一个解决方案。 IE8 was caching my fetchAll() method from Ember Data. IE8从Ember Data缓存了我的fetchAll()方法。 The solution was to manually set on the response header that I didn't want Cache: 解决方案是手动在不需要缓存的响应标头上设置:

Cache-Control:no-cache Content-Type:application/json Date:Tue, 31 Mar 2015 09:35:48 GMT Pragma:no-cache Server:Apache-Coyote/1.1 Transfer-Encoding:chunked Cache-Control:no-cache内容类型:application / json日期:Tue,31 Mar 2015 09:35:48 GMT Pragma:no-cache服务器:Apache-Coyote / 1.1 Transfer-Encoding:chunked

Thanks !! 谢谢 !!

Problably this is because you are directly accessing the type and ie8 doesn't support computed properties. 可能是因为您直接访问类型,而ie8不支持计算属性。 Can you check using proper Ember getters? 您可以使用正确的Ember吸气剂检查吗?

var type = self.controller.get('model.type');

this.controller.get('model').get('store').unloadAll(type);
this.controller.get('model').get('store').fetchAll(type);

You can also try access controllers like this: var type = self.get('controller.model.type'); 您也可以尝试这样的访问控制器:var type = self.get('controller.model.type');

this.get('controller.model.store').unloadAll(type);
this.get('controller.model.store').get('store').fetchAll(type);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Javascript不适用于Chrome和Firefox,但适用于IE - Javascript doesn't work on Chrome and Firefox, but works on IE JavaScript时钟可在Chrome上使用,但不适用于Firefox或IE - JavaScript clock works on Chrome but doesn't work with Firefox or IE JavaScript代码在chrome上有效,在IE和Firefox上无效 - JavaScript code works on chrome, doesn't work on IE and firefox Javascript 自动完成功能适用于 IE 和 Chrome,不适用于 Firefox - Javascript autocomplete works in IE and Chrome, doesn't work in Firefox .unbind('submit')。submit()在Chrome / IE中有效,但在Firefox中无效 - .unbind('submit').submit() works in Chrome/IE but doesn't work in Firefox JS正则表达式代码不适用于Firefox,但适用于Chrome和IE - JS regex code doesn't work with firefox, but works on chrome and IE 该Javascript在IE中不起作用,但在Chrome,Firefox和Opera中起作用 - This Javascript doesn't work in IE but works in Chrome, Firefox and Opera jQuery模糊在Firefox和Chrome中不起作用,但在IE9中起作用 - Jquery blur doesn't work in Firefox and Chrome but works in IE9 在IE8中,并非每次都能获得对嵌套框架对象的引用。 当添加一个alert()时,它可以工作! - Getting a reference to a nested frame object doesn't work everytime in IE8. It works when adding an alert()! Javascript仅在IE Quirks,7和Chrome和Firefox中有效。 在IE 8或9标准中不起作用 - Javascript only works in IE Quirks, 7 and Chrome and Firefox. Doesn't work in IE 8 or 9 Standards
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM