Evgenij Reznik
Evgenij Reznik

Reputation: 18614

Passing Umlauts to jQuery UI Dialog

I'm trying to set some text to jQuery UI Dialog.

When passing a text with Umlauts, it appears in the body as intended, but in the title as ü.

$(document).ready(function() {
  zeigeDialog("ü", "ü");
})

function zeigeDialog(title, message) {
  $("#dialog").dialog({
    modal: true,
    title: title,
    buttons: {
      Ok: function() {
        $(this).dialog('close');
      }
    }
  });
  $("#dialog_Text").html(message);
}

Here is a fiddle.

Upvotes: 1

Views: 332

Answers (1)

potatopeelings
potatopeelings

Reputation: 41075

Just create a dummy element, set it's html using your title and retrieve the text. Then use that to set the title

...
title: $('<span></span>').html(title).text(),
...

Fiddle - https://jsfiddle.net/e7e07ajr/

Upvotes: 1

Related Questions