jquery - 如何在 jQuery 对话框标题中显示俄语文本

标签 jquery jquery-ui jquery-ui-dialog

如何在 jQuery 对话框标题中显示俄语文本?就我而言,它只显示了这个 - ??????

有人知道为什么吗?

调用showAjaxDialog:

$('.ajaxDialog').click(function () {
    ShowAjaxDialog(true, 'Привет Мир', 330, 300, this.href);
    return false;
});

AjaxDialog代码:

function ShowAjaxDialog(isModal, title, width, height, url) {   
    // show a spinner or something via css
    var dialog = $('<div style="display:none" class="ajaxDialogLoading"></div>').appendTo('body');

    // open the dialog
    dialog.dialog({
        // add a close listener to prevent adding multiple divs to the document
        close: function (event, ui) {
            // remove div with all data and events
            dialog.remove();
        },
        width: width,
        height:height,
        modal: isModal,
        title: title
    });

    // load remote content
    dialog.load(
        url,
        //{}, // omit this param object to issue a GET request instead a POST request, otherwise you may provide post parameters within the object
        function (responseText, textStatus, XMLHttpRequest) {
            // remove the loading class
            dialog.removeClass('ajaxDialogLoading');
        }
    );      
    //prevent the browser to follow the link
}

最佳答案

演示: http://jsfiddle.net/mhLc5/

链接: http://jqueryui.com/demos/dialog/

代码:

var $Dialog_div;

function fnOpenDialog() {
    $Dialog_div = $('<div id=\'ThisDialog\'>Hello</div>').prependTo('body');

    $Dialog_div = $('#ThisDialog').dialog({
        autoOpen: true,
        draggable: true,
        resizable: true,
        title: 'Dialog put russian text: Jquery скалы, скалы и StackOverflow',
        modal: true,
        stack: true,
        height: ($(window).height() * 0.95),
        width: ($(window).width() * 0.9),
        buttons: {
            'OK': function() {
                $Dialog_div.dialog('close');
            }    
        }
    });  
}

$('#ClickMe').click(fnOpenDialog);​

HTML:

<!-- This is more than likely an Adobe issue where it thinks it should be in the front
     all the time, no matter what. However, it is very annoying that you can't open
     a dialog over a PDF.-->

<body>
    <div id='ClickMe'>Click here!</div>
    <br/>
    <div></div>
    <br/>
</body>

关于jquery - 如何在 jQuery 对话框标题中显示俄语文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10396913/

相关文章:

jquery - 如何本地化 JQueryUI 模式对话框上的按钮

jquery - 将父 DIV 高度调整为内部内容(RSS 提要)

javascript - 为什么我不能在这里访问 jquery select val ?

javascript - jQuery UI 小部件 - 对象没有方法 _super

javascript - 如何加载多个 JQuery 插件?

javascript - Ext JS 4 中的可排序列表

jQuery UI - 覆盖插件方法

jquery-ui 对话框单击时滚动到页面底部

javascript - jQuery 将 xml 解析为嵌套列表

JavaScript 正则表达式。获取图片src