2012-03-25 5 views
0

클라이언트 용 smalle 웹 응용 프로그램을 가지고 있지 않습니다. Firefox, Chrome, IE7, IE8 및 IE9에서 테스트했습니다.Jquery 대화 상자 IE9 콘텐츠가 html로 표시되지 않습니다.

이제는 실패 할 수 없습니다. 내가 테스트 한 모든 브라우저/버전에서 작동합니다. 내 고객이 앉아있는 것이 확실하지 않지만 IE9라고했습니다.

코드는 이것이다 :

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'); } 

아니 아주 일반적인 기능을하지만 순간에 실패 이잖아. 그는 대화 상자 팝업이 대화 상자에 내용이 없을 때 말합니다. 그는 버튼을 볼 수 있지만 대화 자체에는 HTML이없는 것처럼 보입니다.

아이디어가 있으십니까?

업데이트 : Btw는 여러 대화 상자를 활성화 할 수 있으며 결과는 모두 동일합니다. 내용이없는 대화 상자.

UPDATE2 :이 기능을 사용하는 예는 다음과 같습니다.

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; 
} } 

답변

0

귀하의 html 변수가 다른 곳을 선언하지 않는 한, 기능의 범위 내에서 접근 할 필요가있다 : 클라이언트는 일부 제품을 주문합니다. 제공 한 코드에서 html은 함수 인수이며 함수 외부에서는 항상 '정의되지 않음'입니다.

+0

함수 함수 noticeBox (type, html, title) {html을 사용해야하고 함수의 맨 아래에 html을 사용할 때 $ ('# notice_box'). html (html); –

0

나를 위해 잘 작동합니다.

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

클라이언트가 HTML-인수에 공급하고 무엇 :

는이 같은 함수를 사용? 어떤 HTML은 아마도 엉망이 될 수 있습니다. 아니면 단순히 고객이 왜 그걸 보여주지 않았는지 설명 할 수있는 기회를 놓친 것일 수도 있습니다.

+0

클라이언트 dosent는 기능이 넣는 내용을 제어합니다. 주문하는 제품의 수에 따라 동적으로 생성됩니다. 예제는 다음과 같습니다 주요 주제 UPDATE 2에서 –

+0

'

Beskrivelse
Antal kasser
Baneguide
1
Brevpapir A4 m. Fl kort, Vnr. 006
1
' –

+0

봐가 더 잘 –

관련 문제