Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Сазнај више

Animated gif freeze when window.location.href is set

  • 1 одговор
  • 5 има овај проблем
  • 1 преглед
  • Последњи одговор послао hugogirard28

more options

Hi,

In my login page when the user click the login button he's redirected to another page with javascript using window.location.href.

When the user press the login button a animated gif appear so he knows something is loading but when I change the window.location.href the animated gif stop working.

I found a workaround in IE doing this :

               var loadingFigure = $('#loadingImage');
               var html = loadingFigure.html();            
               window.location.href = returndata.message;
               loadingFigure.html(html);

But is not working in firefox and I have a lot of users that use firefox so I need the busy indicator to continues working.

Anyone have a workaround.

Here my HTML for the gif

                <figure id='loadingImage' class="animationCreateAccount">                    
                    @Resource.TooltipLoading
                </figure>
Hi, In my login page when the user click the login button he's redirected to another page with javascript using window.location.href. When the user press the login button a animated gif appear so he knows something is loading but when I change the window.location.href the animated gif stop working. I found a workaround in IE doing this : var loadingFigure = $('#loadingImage'); var html = loadingFigure.html(); window.location.href = returndata.message; loadingFigure.html(html); But is not working in firefox and I have a lot of users that use firefox so I need the busy indicator to continues working. Anyone have a workaround. Here my HTML for the gif <figure id='loadingImage' class="animationCreateAccount"> <img id='loadingIndicator' src="/images/loading.gif" alt="@Resource.TooltipLoading" title="@Resource.TooltipLoading"/> </figure>

Изабрано решење

I finally found I work around, I added an iframe, is not the best approach I'm agree but sometimes you need to do some workaround.

Here how I did it.

<iframe id="myIframe" src="/images/busy.gif" title="@Resource.TooltipLoading" scrolling="no" frameborder="0"></iframe>

And the js

 $('#myIframe').attr('src', '/images/busy.gif');
 window.location.href = 'mylocation'       
 $('#myIframe').attr('src', '/images/busy.gif');
Прочитајте овај одговор са објашњењем 👍 0

Сви одговори (1)

more options

Одабрано решење

I finally found I work around, I added an iframe, is not the best approach I'm agree but sometimes you need to do some workaround.

Here how I did it.

<iframe id="myIframe" src="/images/busy.gif" title="@Resource.TooltipLoading" scrolling="no" frameborder="0"></iframe>

And the js

 $('#myIframe').attr('src', '/images/busy.gif');
 window.location.href = 'mylocation'       
 $('#myIframe').attr('src', '/images/busy.gif');

Измењено од стране cor-el