views:

104

answers:

1

Hi all,

I have a web application running in Pocket IE (not sure of the exact PIE version, but the OS is Windows Mobile 5.0).

So basically our pages load up and depending on certain things, we focus on a particular form field (ready to accept data from the barcode scanner). To do this, we add some onload code to the body tag.

Now every now and again, the field will gain and then lose focus. From my perspective it's almost like when the CSS file is taking longer than expected to load, for example, the field gains focus, then the CSS gets applied and in doing so, the field loses focus.

The version of PIE that we're using doesn't seem to support onready, so we're stuck with this onload.

Does anyone have any thoughts on how to stop these fields losing focus (or, alternatively, to push the focus back if it is lost).

Any thoughts, suggestions, comments would be greatly appreciated!

A: 

For anyone else with this problem...

The way I resolved it was to put the CSS directly into the HTML head. Not the best solution from a bandwidth / 'reuse' point of view, but it works like a charm.

To be completely honest what I do now is call a PHP function that I wrote that 'wraps' the CSS file. If the browser is of the Pocket-IE variety, my function just reads the file and outputs it in the appropriate 'style' tags. If the browser is not Pocket-IE, my function outputs a normal stylesheet link tag, pointing back to the CSS file. That way, 'normal' browsers get to cache the file still.

Anyway, just wanted to note this here.

Narcissus