If javascript is enabled (and usually is for web2py pages), the easiest way is to load the gif when you load the referencing page (that is, the page with the link to be clicked). Load it with attribute
visibility set to
hidden. Use the js to detect the link click, and set the attribute to
visible.
If you're doing a
LOAD() within the referencing frame, then the
DIV where the
LOAD() occurs can include
<span class="fa fa-spinner fa-spi"></span>
I haven't done this for a while, so a good refresher for me.
/dps