简体   繁体   English

jQuery对话框IE9内容未使用html显示

[英]Jquery dialog IE9 content not showing using html

I have dont a smalle web application for a client. 我没有一个客户端的Smalle Web应用程序。 I have tested it in firefox, chrome, IE7, IE8 and IE9. 我已经在Firefox,Chrome,IE7,IE8和IE9中对其进行了测试。

Now I cant get it to fail. 现在我不能让它失败。 Its working in every browser/version I have tested. 我测试过的每个浏览器/版本都可以使用它。 Im not sure what build my client is sitting with but he said it was IE9. 我不确定我的客户正在使用什么版本,但他说这是IE9。

The code is this: 该代码是这样的:

function noticeBox(type, html, title) {
switch(type) {
    case 1:
    $('#notice_box').dialog({
        title: title,
        width: 400,
        modal: true,
        position: 'center',
        buttons: {
            'Ok': function() {
                $(this).dialog('close');
            }
        }
    });     
    break;
    case 2:
    $('#notice_box').dialog({
        title: title,
        width: 800,
        modal: true,
        position: 'center',
        buttons: {
            'Bekræft og bestil': function() {
                $('#form_products').submit();
            },
            'Annuller': function() {
                $(this).dialog('close');
            }
        }
    });     
    break;
    case 3:
    $('#notice_box').dialog({
        title: title,
        width: 400,
        modal: true,
        position: 'center',
        buttons: {
            'Luk': function() {
                $(this).dialog('close');
            }
        }   
    });
    break;
}
alert(html);
$('#notice_box').html(html);
$('#notice_box').dialog('open'); }

Not a very generic function but thats what is failing at the moment. 这不是一个非常通用的功能,但这就是当前失败的原因。 He says that when the dialog pop's there is no content in the dialog. 他说,弹出对话框时,对话框中没有内容。 He can see the buttons but is like there is no html in the dialog it self. 他可以看到按钮,但就像对话框本身没有html一样。

Any ideas? 有任何想法吗?

UPDATE: Btw he can active several dialogs and the result is the same in all of them. 更新:顺便说一句,他可以激活多个对话框,并且所有对话框的结果都相同。 Dialogs without any content. 没有任何内容的对话框。

UPDATE2: An example how I use that function is this. UPDATE2:我如何使用该功能的示例如下。 When a client orders some products: 当客户订购某些产品时:

function order() {
var procuct_str = '';
var found_order = false;
$.each($('.order_input'), function(){
    var product_id = $(this).attr('id').split('-');
    if(parseInt($(this).val()) > 0) {
        found_order = true;
        procuct_str = procuct_str+'<div class="float_left"><span class="bread_text">'+$('#description-'+product_id[1]).text()+'</span></div><div class="float_right"><span class="bread_text">'+$(this).val()+'</span></div><div class="clear"></div>';
    }
}); 

if(found_order == true) {
    procuct_str = '<div class="float_left"><b>Beskrivelse</b></div><div class="float_right"><b>Antal kasser</b></div><div class="clear"></div>'+procuct_str;

    noticeBox(2, procuct_str, 'Bekræftelse');
    var found_order = false;
} }

Your html variable needs to be accessed within the scope of the function, unless you've declared it elsewhere. 您的html变量需要在函数范围内访问,除非您在其他地方声明了它。 From the code you provided, html is a function argument, and outside the function it will always be 'undefined'. 从您提供的代码中, html是一个函数参数,在函数之外,它将始终是“ undefined”。

It works fine for me. 这对我来说可以。

I used your function like this: 我这样使用您的功能:

noticeBox(1, "<p>Hello</p>", "Test");

What is your client supplying for the html-argument? 您的客户为html参数提供了什么? Some html could possibly mess it up. 一些html可能将其弄乱。 Or simply maybe your client left it out which would explain why nothing is showing. 或者只是您的客户忽略了它,这可以解释为什么什么都没显示出来。

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

相关问题 使用iframe的jQuery对话框在IE9中不起作用 - Jquery dialog with Iframe not working in IE9 jQuery fullcalendar不显示IE9中的事件 - jQuery fullcalendar not showing events in IE9 IE9-使用jQuery将HTML表格加载到页面中 - IE9 - Loading html table into a page with jQuery jQuery-在IE9中获取附加内容的HTML(没有选择包装的选项) - jQuery - Get HTML of appended content in IE9 (options without select wrapper) 我想根据内容调整jQuery jQuery对话框的宽度,但是自动宽度功能在IE9中不起作用, - i want to jQuery ui dialog's width to be adjusted according to content, But auto-width feature wont work in IE9 , 如何通过jQuery或Javascript在IE9和11中显示“另存为”对话框 - How to show a “save as” dialog in IE9 and 11 via jQuery or Javascript jQuery zClip在Chrome和IE9的UI对话框中不起作用(在FireFox中有效) - jQuery zClip not working in UI dialog in Chrome and IE9 (works in FireFox) 在IE9中使用HTML5 pushState() - Using HTML5 pushState() in IE9 IE7使用jQuery隐藏/删除/显示内容的问题 - Issue with IE7 hiding/removing/showing content using jQuery jQuery $()。css(“content”)在IE9中返回字符串“normal” - jQuery $().css(“content”) returning the string “normal” in IE9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM