简体   繁体   English

javascript确认框中显示的瑞典语消息显示问号(?)

[英]Swedish message shown in javascript confirm box showing question mark(?)

function ConfirmGroupDelete() {
            if (confirm('Är du säker på att du vill ta bort alla händelser i gruppen Test3?')) {
                return true;
            } else {
                return false;
            }
        }

I want swedish message when button clicked but it showing following. 单击按钮时我想要瑞典语消息,但显示如下。

在此处输入图片说明

Please help me how will I solve it? 请帮助我如何解决?

function ConfirmGroupDelete() {
            var labelMsg = document.createElement("Label"); // create Label dynamically
            labelMsg.innerHTML = "Är du säker på att du vill ta bort alla händelser i gruppen Test3?";

            if (confirm(labelMsg.innerHTML)) {
                return true;
            } else {
                return false;
            }
}

Now I did like this way. 现在我确实喜欢这种方式。 I have found corresponding HTML code of swedish word and replace it into my message. 我找到了瑞典语单词的相应HTML代码,并将其替换为我的消息。 Then I have created a label dynamically and set that message into the innerHTML property of the Label and then shown in the confirm box. 然后,我动态创建了一个标签,并将该消息设置为Label的innerHTML属性,然后显示在确认框中。 If I direct put the message into confirm("") then it shows as normal text(&Amul is showing). 如果我直接将消息放入confirm(“”),那么它将显示为正常文本(&Amul正在显示)。 I don't know what is the reason behind it, If anybody has good suggestion, you can tell me. 我不知道背后的原因是什么,如果有人有好的建议,您可以告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM