the use of loading.gif

Skip to first unread message

Rune Back

Apr 14, 2015, 1:31:38 AM4/14/15
How do I use the loading.gif ? I would be interested in using it with a (a)synchronous request i.e. at login when checking with the server that the login info is correct.



Mogens Beltoft

Apr 14, 2015, 2:06:54 AM4/14/15
In async calls you set up a callback funtion to receive the result of e.g. the login. The callback function removes the loading.gif while you set the loading.gif just before starting the async call.

Have a look at this:

You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

Rune Back

Apr 15, 2015, 2:42:32 AM4/15/15
Thank you for the answer! - I've been doing it in the following way, which doesn't seem so neat although it works:

var junk=document.getElementById("submitButtonText").innerHTML
document.getElementById("submitButtonText").innerHTML = "Working..."
// fetching the info from the server
document.getElementById("submitButtonText").innerHTML = junk

I'm sorry for not explaining myself more clearly. - I'm using emy. The main.css should contain everything necessary. I still don't seem to be able to get it to work (although it works here). Furthermore I don't know how to make the loading image to work with a button. Should I just use "my old" way changing the button text?


Remi Grumeau

Apr 15, 2015, 3:49:47 AM4/15/15
to Rune Back,
For this matter, Emy works exactly the same as iUI.
A link in a Li element with a selected="progress" attribute shows up the loading GIF. This attribute is set by internal Ajax mechanism showByHref.

This is the only purpose and default use of this loading gif. If you want to use it on a button or in any other case, you'll have yo code it yourself. That's the KISS philosophy of iUI/Emy.

Doing this is pretty damn simple actually, just add a class to your button (emy.addClass()), create this class in CSS to set the text color to rgba(0,0,0,0) and put the GIF as a background. Remove the class when done.
You're done :)

De : Rune Back
Envoyé : ‎15/‎04/‎2015 08:42
À :
Objet : Re: the use of loading.gif

Reply all
Reply to author
0 new messages