Chrome&的加载指示器上的骨干模型获取步骤. IE [英] Backbone Model fetch steps on loading indicator in Chrome & IE

查看:85
本文介绍了Chrome&的加载指示器上的骨干模型获取步骤. IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,该应用程序在通过主干获取模型数据时显示loading.gif.代码大致如下:

We have an app that shows a loading.gif while fetching a models data via backbone. The code pretty much looks like:

$('.loading-indicator').show()
myModel.fetch({async: false}) 
setSomeOtherVar = Date.today() //some var unrelated to fetch
$('.loading-indicator').hide()

这在FFX中工作正常,但是在Chrome和IE中,调用提取时加载指示消失.我可以通过逐步调试调试器来看到这一点.如果我在提取中设置了断点,则指示符在那里,并且在调用提取时会立即消失.提取成功,并且控制台中没有错误.

This works fine in FFX, but in Chrome and IE the loading indicator disappears when fetch is called. I can see this by stepping through w/ the debugger. If i set a breakpoint on the fetch the indicator is there, and disappears immediately when the fetch is called. The fetch is successful and there are no errors in console.

任何见识都将受到赞赏

推荐答案

我找到了答案,它对我有用.我删除了{async: false},它为我解决了.正如@Alexander Derck所提到的,尝试删除异步,它应该可以工作.

I found the answer to this and it works for me. i removed the {async: false}and it solved for me. As mentioned by @Alexander Derck, try removing the asynchronous and it should work.

这篇关于Chrome&的加载指示器上的骨干模型获取步骤. IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆