views:

524

answers:

1
+7  A: 

val() or value sets a plain text value. … is HTML, not text; you could use it in innerHTML or .html(), but not in a form field value.

If you want to include U+2026 HORIZONTAL ELLIPSIS in a JavaScript string where the encoding is not guaranteed, you could escape it to:

'Loading\u2026'

Should I enter the ellipsis directly from keybord in the code above? Is it safe with UTF-8?

Yes.

However, the ellipsis has a compatibility decomposition into three period characters; it is really only there for backwards compatibility with older character sets. These days the idea is just to use three periods, and let the font deal with coming up with combined glyphs if necessary. In any case, there is little to no visual difference between three periods and an ellipsis in most (proportional) fonts.

bobince