2016-08-31 5 views
1

현재 showModalDialog를 사용하는 따개 창이 있습니다. 이것은 사용되지 않기 때문에 교체해야합니다. 모달 대화 상자 창에 window.return 값이 있습니다. 결과적으로, 단순히 Window.Open을 사용하여 showModalDialog를 대체 할 수 없습니다.값이 반환 될 때 showModalDialog를 바꾸는 방법

이 문제를 해결하기위한 방법이 있습니까?

retval = window.showModalDialog('abc.asp?user=' SomeUser + "center=no;dialogwidth:600px;dialogheight:400px;dialogwidth:600px;dialogheight:400px;help=No;status=yes") 
//DO SOMETHING WITH retval 

모달 대화 상자 창 :

<script> 
    function SaveMe() 
    { 
     window.returnValue = 'Some value that is needed in caller'; 
     window.close(); 
    } 

답변

0

당신은 windows.open()을 시도 할 수 있습니다 다음은 샘플 코드 발신자입니다.

전화 팝업 : 나는 어제 내 웹 사이트를 고정 getReturnValue

function getReturnValue(){ 
//now value is retval.returnValue or something you bind 
console.log(retval.returnValue); 
} 

retval = window.open(......); 
//bind close event to retval 
retval.onunload = getReturnValue; 

그리고 기능.

관련 문제