Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alerting Special Characters using jQuery/JavaScript

How do i display a string with Special Characters like € in a Javascript/jQuery alert?

eg: I want to display a message box with "The Price is €10"

But when i use the below code:

alert("The Price is €10");

The Output shown in the message box is "The Price is €10", I want my output to be "The Price is €10".

Can some help me with this please? Thanks in advance.

like image 361
Chamara Keragala Avatar asked Jan 31 '13 09:01

Chamara Keragala


1 Answers

Use this as the alert. Works fine for me.

alert(' The Price is \u20AC 10');

The description is here : http://leftlogic.com/projects/entity-lookup/

like image 92
Riju Mahna Avatar answered Nov 15 '22 15:11

Riju Mahna