크롬 브라우저에 correcly 팝업 메시지를 표시하는 코드가 있는데 다음과 같은 Firefox 및 Edge와 같은 다른 브라우저에서 테스트했습니다. ... 그냥 페이지의 끝 부분에보고 이상한 상자를 상자, 작동하지 않는 코드는 다음과 같습니다모든 브라우저에서 사용할 수있는 jQuery 또는 Javascript를 사용하여 팝업 상자 만들기
이var iframe = document.createElement("IFRAME");
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
if(window.frames[0].window.confirm("Are you sure you want to change brand state? Note: Changing brand state from Preview to Live will erase all data related to that brand.")) {
$.post("/brand/updateBrandState", {
'brandId': $(this).val(),
"brandState": $(this).find("option:selected").text()
}, function (data) {
if (data == "ok") {
window.location.reload(true);
}else if(data=="empty") {
alert("Cannot change state from Live to Preview");
window.location.reload(true);
}else if(data=="live") {
alert("Brand is now live!");
}
});
누군가가 그것뿐만 아니라 다른 브라우저에서 작동하도록 나를 도와 드릴까요?
감사합니다.
편집 :
지금이 HTML을 사용하여 메신저 : 팝업 상자
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
https://jqueryui.com/dialog/를 확인하십시오. 필요에 따라 스타일을 사용자 정의 할 수 있습니다! – Pugazh
그래,하지만 사용자가 대화 상자에서 "확인"또는 "취소"버튼을 클릭했는지 어떻게 확인할 수 있습니까? 실용적인 예를 들려 주시겠습니까? – perkes456
https://jqueryui.com/dialog/#modal-confirmation을 확인하십시오. 제목 ** 예제 **로 다양한 옵션을 시도해보십시오. ** 소스보기 **를 클릭하여 해당 코드를 확인하십시오. – Pugazh