Forum Moderators: open

Message Too Old, No Replies

displaying raw ampersand (&) entity in textarea

         

Birmingham

9:36 am on Feb 5, 2008 (gmt 0)

10+ Year Member



some browsers convert the ampersand entity into an ampersand, when within textarea, but other browsers don't. so the solution of using & to display & will solve one problem while creating another (the & will be displayed in some browsers)

what is the best solution here? using a div rather than a textarea? (i don't need it to be editable, but some people might!)

FuzzyDriver

2:16 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



I have a global solution to this problem which always serves me well. I never use character entity shorthands like <, &, etc. Instead I use the numerical entities (<, &, etc.). They always work; I don't have to worry about what browser I'm in or whether or not it's XML as opposed to XHTML.