views:

45

answers:

3
document.getElementById("spinner2").style.visibility="visible"

Visibility visable/hidden is very slow on Blackberry (OS4.6). screen seems to be redrawing which makes it unusable in Ajax application.

The goal is to put visible feeback to user while ajax request completes.

Anyone suggest alternative?

A: 

If you change the layout you'll get redraw. If a single redraw is slow then you're layout is too heavy for a mobile application i guess.

galambalazs
layout is fairly heavy, but I am using ajax to compensate.
robert
ajax is about network efficiency not rendering. You can't compensate a heavy layout with ajax.
galambalazs
ajax techniques permit developers to build heavy layout (by which I mean, many functionson a page and several hundred lines of html/js) while at the same time having nibleperformance by using ajax to replace only small amounts of html at a time on the page.
robert
A: 

This should help:

http://dev.opera.com/articles/view/efficient-javascript/?page=3

cheers

Marko
A: 

Is document.getElementById("spinner2").style.display = "block" any better? You would have to start with display: none on the spinner element, and you would need to put it in a fixed box (div) to keep it from re-flowing the layout.

Ishmael