2013-08-04 3 views
0

나는 (mvc4 면도기) 사업부가 있습니다대화 상자를 처음 열면 대화 상자가 열리는 이유는 무엇입니까?

<div onclick='dialogtrigger(this)'>send</div> 

이에 사용자가 클릭 그것이 팝업 대화 상자에서보기를로드하고, 사용자에게 보여 간다 div에.

가 다시 재개하려는 경우 사용자 가까이 대화 상자 후 처음으로 그 사용자가 나에게이 오류 제공,을 클릭 잘 작동 :

0x800a01b6 - JavaScript runtime error: Object doesn't 
support property or method 'dialog' 

내 브라우저 캐시를 청소하고 확인을 내 왜 처음으로 작동하는지 대화 상자를 지원할 수없는 경우 스크립트 파일?

내 기능 코드 : 내 주요보기에

$.ajax({ 
    url: "OpenSendDialog", 
    type: "GET", 
}) 
.done(function (result) { 
    $("#clientdetailmodal").html(result).dialog({ 
     autoOpen: true, modal: true, show: { 
      effect: "blind", 
      duration: 500 
     } 
    }); 
}); 
} 

:

<div id="clientdetailmodal"></div> 

내 컨트롤러 :

[HttpGet] 
public ActionResult OpenSendDialog() 
    { 
    return view(); 
    } 
+0

가능한 복제본 [개체가 속성 또는 메서드 '대화 상자'를 지원하지 않습니다.] (http://stackoverflow.com/questions/15679715/object-doesnt-support-property-or-method-dialog) – Fals

답변

0

내 생각 함수와 그녀의 범위에 문제가. ..

모습 here, 난 그 당신을 도울 바랍니다 :

var dialogtrigger=null; // global scope 
$(function() { 
    dialogtrigger = function(){ 
     //replace with your ajax call 
     $("#clientdetailmodal").html($('#content')).dialog({ 
      autoOpen: false, modal: true, show: { 
       effect: "blind", 
       duration: 500 
      } 
     });  
    } 

$("#opener").click(function() { 
    // or destruct your modal on close and re-call your ajax 
    $("#clientdetailmodal").dialog("open"); 

}); 

});

관련 문제