How to show british pound sign in an option menu using javascript?

I am using javascript to print british prices in a select menu. If I use £ it prints exactly that in the select options but if I use £ then it shows a diamond with a question mark in the middle.

How can I show just the £ like you can just by entering the $? I am using ISO-8859-1 for my character set.

Have a look at this thread

use unicode ‘\u00A3’

What should I do if I have made an AJAX request and return some XML, like

<content>!"£$%^</content>

I can output the string in Firefox just fine but trying to do the same in IE simply shows !" instead of !"£$%^…so obviously the pound sign is causing a problem…I am not too sure about how I can fix my problem I am having with IE. Does anyone have any idea on this one please?

Can you alert the value successfully?

If not, it might be misreading the xml value.

No unfortunately not…in the database the value is ‘£’
Then I use the PHP function htmlentities which converts this to £ so it transferred as well formed XML which meant I also had to add an entity reference in my XML to display £ as £.

This doesn’t really make a difference though as the nodes that the javascript searches through is still shown as £.

I have found a work around but I really don’t think it’s the best idea

In my PHP service I replace ‘£’ with ‘\u00A3’ and display XML
echo str_replace(‘£’,‘\u00A3’,$retXML);

Then in javascript I reverse things…I have no idea why this works
oMessage.getElementsByTagName(‘formname’)[0].firstChild.nodeValue.replace(/\\u00A3/, ‘£’);