μλ°μ€ν¬λ¦½νΈλ₯Ό μ΄μ©νμ¬ νμ μ°½μ μ¬λ λ°©λ²μ λν κΈμ λλ€.
l window.open() ν¨μ
window.open() ν¨μλ₯Ό μ΄μ©νμ¬ μ½κ² νμ μ°½μ μ¬μ©ν μ μμ΅λλ€.
window.open("νμ μ°½μΌλ‘ μ¬μ©ν νμΌ(κ²½λ‘ν¬ν¨) λλ uri","μ§μ ν νμ μ μ΄λ¦","ν¬κΈ°μ μμΉ");
l μμ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function showPopup(){
window.open("test.html","νμ
ν
μ€νΈ","width=400, height=300, top=10, left=10");
}
</script>
</head>
<body>
<input type="button" value="νμ
μ°½ νΈμΆ" onclick="showPopup();">
</body>
</html>
window.open("test.html","νμ ν μ€νΈ","width=400, height=300, top=10, left=10");
popup.htmlλ₯Ό μμ κ°μ΄ ν΄μ£Όμμ΅λλ€.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>νμ
μ°½</h1>
</body>
</html>
νΈμΆν νμ μ°½μ htmlμ λλ€.
μΈλ²μ§Έ μΈμλ₯Ό μ‘°μ νμ¬ νμ μ ν¬κΈ° λν μ‘°μ μ΄ κ°λ₯ν©λλ€.
μ½μ΄μ£Όμ μ κ°μ¬ν©λλ€.
μ§λ¬Έμ μΈμ λ νμν©λλ€.
"λ λ°λμ λ°±μλ μμ΄ λ κ±°μΌ"