simple javascript question (I think)
Posted by: msherwoo
Posted on: 2009-10-23 12:00:00
Not real familar with Javascript. But I think this is easy.
Using sortable from Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
but I believe this to be a general Javascript question. Sortable is a table sorting function.
He uses the following line to choose whether to display a webdings font 5 (which is an up arrow) or the unicode equivalent, depending on whether it is IE. At least that's what I think this line is doing:
sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : '&nb__sp;%__B4;';
(I inserted 2 underscores above so the browser doesn't render this code. )
where stIsIE is defined as:
var stIsIE = /*@cc_on!@*/false;
whatever that means.
I believe this is a workaround for IE 6 and 7 since they don't display this unicode character properly. But the problem is that with IE8 it will display the unicode properly, but it won't display the webdings properly (it shows it as a "5"). So, I think I need a way to distinguish between IE 8 and earlier versions and then use either webdings or unicode depending.
And basically, I have no idea how to do that or even if that is the right approach. Thus, help requested.
if more code extracts are needed, the whole script is available from his site
http://www.kryogenix.org/code/browser/sorttable/
Thanks,
Mike