Reputation: 18237
I have some HTML rendered by ajax, which works perfectly fine using the char-set utf-8
nevertheless some content it's appended to the dom by a JavaScript function using jquery. The problem is, the HTML rendered doesn't have the correct char-set.
Here's the example of the content added by JavaScript
var html = '<div class="right-item-container"><a href="#"><span style="font-size:24px;" class="item-friend-name">Mamá</span></a><br/><a href="#"><span class="clubName-container">school</span></a></div>';
$('.profile-container').empty().css({ 'padding-top' : '0'}).html(html);
It renders like this:
Upvotes: 3
Views: 69
Reputation: 464
This works fine in a fiddle.
var html = '<div class="right-item-container"><a href="#"><span style="font-size:24px;" class="item-friend-name">Mamá</span></a><br/><a href="#"><span class="clubName-container">school</span></a></div>';
$('#test').html(html);
So it must be the way your original content is encoded.
Upvotes: 3