[英]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.