Welcome to WebmasterWorld Guest from 54.197.66.254

Forum Moderators: open

Message Too Old, No Replies

ajax and pound and euro symbols

ajax and pound and euro symbols not displaying

     
9:59 pm on Jun 21, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:July 9, 2003
posts:405
votes: 0


I've got a php function that gets from the user perferred currency symbol from a MySQL DB.

When I store it, it's a standard POST php page. The bog standard page returns and displays the pound and euro symbols fine...

When I want to display it, it's via an ajax function "populating" a div with what's returned by calling a document to return a number and stick the user currency in front of it..........however it's rendered via a <div name>.innerHTML=xmlHttp.responseText javascript function which isn't sorting the rendering of the symbols correctly.

Is it something I could sort with JavaScript unescape function (store an escaped or ?)....and does that have security implications if somehow I get escaped junk in my DB - or am I missing a cleaner way of doing it?

Newish to php/ajax/mySQL - being old school it's always easier to knock up with classic asp/MSAccess - but you just can't impress the punters these days with endless page refreshes, and a desktop DB :)!

10:05 pm on June 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


Well, you could always CDATA the string ... or use &euro; or &pound;
9:48 pm on June 22, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:July 9, 2003
posts:405
votes: 0


cheers - i'd missed something in my function not converting to & pound etc properly - was thinking it was something more complex than it was, but all sorted now :)