X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

Animated gif freeze when window.location.href is set

Posted

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>

Chosen solution

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');
Read this answer in context 0

Additional System Details

Installed Plug-ins

  • Google Update
  • Next Generation Java Plug-in 10.11.2 for Mozilla browsers
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • The plugin allows you to have a better experience with Microsoft Lync
  • Adobe PDF Plug-In For Firefox and Netscape 11.0.01
  • iTunes Detector Plug-in
  • The plugin allows you to have a better experience with Microsoft SharePoint
  • 5.1.10411.0

Application

  • User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0

More Information

Chosen Solution

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');

Modified by cor-el