Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Regular Contributor
iruka
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi

Loading Image(Gif) Won't Display

[ Edited ]

Hi all. I have this app that retrieve data using jQuery $.ajax. While it is retrieving the data, there should be a loader gif but it won't show up on the device.

 

function getData()
{
  $.ajax({
    type: 'GET',
    url: 'http://www.somedomain.com/somedirectory/webservices',
    data: { some data },
    beforeSend:function() 
    {
      var strLoader = "";
       
      strLoader += '<div id="loaderContainer">';
      strLoader += '<div id="loaderWord">Loading.....</div>';
      strLoader += '<div id="loaderImage"><img src="images/loader.gif" /></div>';
      strLoader += '</div>';//end of loaderContainer

      $('#content').html(strLoader);
    },
    success:function(data) 
    {
      //retrieve data if retrieval is successful
    }
    error:function()
    {
      //display message if there's error
    }
  });
}

 In Ripple Emulator, the loader.gif is shown but when installed on the device it is loader.gif is not shown but the "Loading....." text is being displayed.

 

Can anyone please help?

 

Thank you.

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Loading Image(Gif) Won't Display

Check the naming of the file and path locations.  I had an image not showing because while testing on windows the uppercase lowercase thing didn't apply but on the device its case sensitive.

If it helped you, click like. :smileyhappy:
Please use plain text.
Regular Contributor
iruka
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi

Re: Loading Image(Gif) Won't Display

The naming of the file and path location are all correct.

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Loading Image(Gif) Won't Display

I know its three weeks ago, did you ever get the answer to this?

If it helped you, click like. :smileyhappy:
Please use plain text.
Regular Contributor
iruka
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi

Re: Loading Image(Gif) Won't Display

Still havent' got any answer to it. But maybe it could be bandwidth problem. There are times when the retrieving data from server and the loading time is fast, it's hard to come to this screen. There are times when the retrieving is slow this loader will appear.

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Loading Image(Gif) Won't Display

Hey iruka,

 

Have you tried placing the 'beforeSend' code outside of the jquery ajax function to see if you get different results? Try this:

 

function getData()
{
  var strLoader = "";
   
  strLoader += '<div id="loaderContainer">';
  strLoader += '<div id="loaderWord">Loading.....</div>';
  strLoader += '<div id="loaderImage"><img src="images/loader.gif" /></div>';
  strLoader += '</div>';//end of loaderContainer

  $('#content').html(strLoader);

  $.ajax({
    type: 'GET',
    url: 'http://www.somedomain.com/somedirectory/webservices',
    data&colon; { some data },
    success:function(data) 
    {
      //retrieve data if retrieval is successful
    }
    error:function()
    {
      //display message if there's error
    }
  });
}

 

 Just in case its the jquery that's causig the hiccup -- good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.