diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/api/window/confirm | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/ko/web/api/window/confirm')
-rw-r--r-- | files/ko/web/api/window/confirm/index.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/files/ko/web/api/window/confirm/index.html b/files/ko/web/api/window/confirm/index.html new file mode 100644 index 0000000000..f2895337bd --- /dev/null +++ b/files/ko/web/api/window/confirm/index.html @@ -0,0 +1,76 @@ +--- +title: Window.confirm() +slug: Web/API/Window/confirm +tags: + - API + - HTML DOM + - Method + - Reference + - Window +translation_of: Web/API/Window/confirm +--- +<div>{{ApiRef("Window")}}</div> + +<p><code><strong>Window.confirm()</strong></code> 메서드는 확인과 취소 두 버튼을 가지며 메시지를 지정할 수 있는 모달 대화 상자를 띄웁니다.</p> + +<h2 id="구문">구문</h2> + +<pre class="syntaxbox notranslate"><em>result</em> = window.confirm(<em>message</em>); +</pre> + +<h3 id="Parameters">Parameters</h3> + +<dl> + <dt><code>message</code></dt> + <dd>경고 대화 상자에 표시할 텍스트 문자열.</dd> +</dl> + +<h3 id="반환_값">반환 값</h3> + +<p>확인 (<code>true</code>) 또는 취소 (<code>false</code>) 중 사용자가 선택한 값. 브라우저가 페이지 내 대화 상자를 무시하고 있으면 항상 <code>false</code>입니다.</p> + +<h2 id="예제">예제</h2> + +<pre class="brush: js notranslate">if (window.confirm("Do you really want to leave?")) { + window.open("exit.html", "Thanks for Visiting!"); +} +</pre> + +<p>위 코드는 다음 결과를 보입니다.</p> + +<p><img alt="firefox confirm" src="https://mdn.mozillademos.org/files/7163/firefoxcomfirmdialog_zpsf00ec381.png" style="height: 119px; width: 354px;"><br> + </p> + +<h2 id="참고">참고</h2> + +<p>대화 상자는 모달 창(부모 창으로 돌아가기 전에 사용자의 상호 작용을 요구하는 자식 창)으로, 사용자는 대화 상자가 닫힐 때까지 다른 모든 인터페이스에 접근할 수 없습니다. 따라서 대화 상자(또는 모달 창)를 만드는 함수를 남용하면 안 됩니다. 이 뿐만이 아니더라도, <a href="https://alistapart.com/article/neveruseawarning/">대화 상자로 사용자 확인을 받는 것은 피해야</a> 할 좋은 이유 여럿이 존재합니다.</p> + +<h2 id="명세">명세</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG', 'timers-and-user-prompts.html#dom-confirm', 'confirm()')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + + + +<p>{{Compat("api.Window.confirm")}}</p> + +<h2 id="같이_보기">같이 보기</h2> + +<ul> + <li>{{domxref("window.alert()")}}</li> + <li>{{domxref("window.prompt()")}}</li> +</ul> |