다음 함수 openwin()을 사용하여 페이지를 작성하고 엽니 다. 문제는 myWindow.document.close(); IE10 호환 모드를 사용할 때 실패합니다.
크래시 보고서에 document.close()를 참조하는 "원격 프로 시저 호출에 실패했습니다"가 표시됩니다.document.close() 함수는 ie10 호환성 모드가 실패하게합니다.
디버거를 단계별로 실행해도 실패하지는 않습니다 (아마도 어딘가에 자동으로 문서가 닫힙니다).
문서를 닫지 않으면 (IE 모드에서) 페이지가 자바 스크립트 (google translate)를로드하기 전에 30 초 정도 기다립니다. 아마도 페이지가 종료되고 자체적으로 문서가 닫히고 자바 스크립트가 실행됩니다.
어떤 문제가 발생했는지 (IE10 호환 모드에서는 실패 했습니까?)?
또한이 문제는 페이지에 스크립트가 포함되어있을 때만 발생합니다.
감사합니다.
Fergal. 당신이 변화를 않는 첫 번째 쓰기 전에 document.open()를 추가하면
는function openWin(){
if($('#worksheetbtn').data('created')==true){
var day = new Date();
var id = day.getTime();
myWindow=window.open("",id);
myWindow.document.write('<html><head>');
myWindow.document.write('<meta name="google-translate-customization" content="8920959a5c7c1a2e-252a0ea397b87b27-g0d7aa06f124f9dec-14"></meta>');
myWindow.document.write('<style type="text/css"> td {valign="top";} td.upper_line { border-top:solid 1px ;}table.fraction {border-top-color: #000000;text-align: center; vertical-align: middle; margin-top:0.5em; margin-bottom:0.5em; line-height: 2em; }</style> ');
myWindow.document.write('<title> Steps To Maths Worksheet Creator - STM The software for Learning Maths Online. </title>');
myWindow.document.write('</head> <body>');
myWindow.document.write('<div id="google_translate_element">Translate</div>');
myWindow.document.write('<p>Steps To Maths </p>' );
myWindow.document.write($('#worksheetbtn').data('worksheet_html'));
myWindow.document.write('</body>');
myWindow.document.write('<script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: \'en\', autoDisplay: false}, \'google_translate_element\');}</script>');
myWindow.document.write('<script type="text/javascript" src="\/\/translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>');
myWindow.document.write('</html>');
myWindow.focus();
// myWindow.document.close();
} else alert('The worksheet cannot be opened, please select a category, number of questions and click on the Load Questions button');
}
를 사용할 수 있습니까? [기본적으로 첫 번째 document.write는 내부적으로 호출해야하지만 IE로는 알 수 없다] – epascarello