2

This code works very well:

Html

<html><body>
<div id="container"></div>
</body></html>

Jquery

$('<div id="footer"><p>جميع الحقوق محفوظه لشركة</p></div>').insertAfter('#container');

but the problem in Arabic letters its look like that:

������������������������
tshepang
  • 12,111
  • 21
  • 91
  • 136
  • possible duplicate of [Displaying unicode symbols in HTML](http://stackoverflow.com/questions/1696619/displaying-unicode-symbols-in-html) – Pekka Aug 09 '10 at 19:25
  • This is a character set issue: You need to get your encodings right. Good basic reading: http://www.joelonsoftware.com/articles/Unicode.html – Pekka Aug 09 '10 at 19:26

2 Answers2

4

You should probably specify an encoding on your page to get around issues like this. Here's a page from the W3C on specifying character encodings:

http://www.w3.org/TR/html4/charset.html#h-5.2.2

You should be fine with UTF-8, which you can specify by putting the following tag in your <head> tag:

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
Faisal
  • 4,687
  • 1
  • 19
  • 13
0

Try using escape():

$('<div id="footer"><p>'+escape('جميع الحقوق محفوظه لشركة')+'</p></div>').insertAfter('#container');