HTML Entities -- can one test if they displayed properly?

  • Thread starter Jeremy J Starcher
  • Start date
J

Jeremy J Starcher

On my current project, I have an input that is similar to a spinbox
control, allowing the user to shift a graphic or resize it.

This HTML displays correctly on all browsers[1] I have tested.
<a href="#" onclick="return shift('form_r', +1);"> &uarr; </a>


This display correctly on all browsers I have tested save for, of course,
IE.
<a href="#" onclick="return shift('form_r', -10);"> &lArr; </a>


I know that I could use a graphic if I had to, but I'd rather KISS if I
can.

So... any hints on how to test of an HTML entity is available? I'll drop
in a 'v' and '^' for up and down and replace with a double-lined arrow if
available.

(Ramblings ... not JS but it may be a solution...)
Is there a standard font that is required to have all of these HTML
entities identified? I'm using the browsers default font, but I'll
change fonts if I have to...


[1] Well, all graphical based browsers anyways. Since this is an image
map editor, I really don't know (or care) what Lynx thinks of it.
 
D

David Mark

On my current project, I have an input that is similar to a spinbox
control, allowing the user to shift a graphic or resize it.

This HTML displays correctly on all browsers[1] I have tested.
<a href="#" onclick="return shift('form_r', +1);"> ↑ </a>

This display correctly on all browsers I have tested save for, of course,
IE.
<a href="#" onclick="return shift('form_r', -10);"> ⇠</a>

I know that I could use a graphic if I had to, but I'd rather KISS if I
can.

Text sizes better than graphics as well.
So... any hints on how to test of an HTML entity is available?

ISTM you could set the innerHTML of a created element and check to see
if its text content contains the expected character. But then you
could skip the entity altogether (just use the character as you seem
to have done above).
 I'll drop
in a 'v' and '^' for up and down and replace with a double-lined arrow if
available.

(Ramblings ... not JS but it may be a solution...)
Is there a standard font that is required to have all of these HTML
entities identified?

Fonts have nothing to do with entities. Browsers translate entities
(they know of) to characters. If the browser can't find a character
in the available fonts, it renders a blank.
I'm using the browsers default font, but I'll
change fonts if I have to...

What font(s) are specified in the document's CSS?
[1]  Well, all graphical based browsers anyways.  Since this isan image
map editor, I really don't know (or care) what Lynx thinks of it.

Why would a text browser have trouble displaying a text link?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top