λ‘œμΌ“πŸΎ
article thumbnail

 

μžλ°”μŠ€ν¬λ¦½νŠΈλ₯Ό μ΄μš©ν•˜μ—¬ νŒμ—… 창을 μ—¬λŠ” 방법에 λŒ€ν•œ κΈ€μž…λ‹ˆλ‹€.

 


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μž…λ‹ˆλ‹€.

 

νŒμ—…μ°½ 호좜 λ²„νŠΌμ„ ν΄λ¦­ν•˜κ²Œ 되면 νŒμ—…μ΄ λ‚˜νƒ€λ‚©λ‹ˆλ‹€.

 

νŒμ—…μ°½μ΄ λ‚˜νƒ€λ‚¬μŠ΅λ‹ˆλ‹€.

 

μ„Έλ²ˆμ§Έ 인자λ₯Ό μ‘°μ •ν•˜μ—¬ νŒμ—…μ˜ 크기 λ˜ν•œ 쑰절이 κ°€λŠ₯ν•©λ‹ˆλ‹€.

 

 

 

μ½μ–΄μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.

μ§ˆλ¬Έμ€ μ–Έμ œλ‚˜ ν™˜μ˜ν•©λ‹ˆλ‹€.

 

"λ‚œ λ°˜λ“œμ‹œ λ°±μ—”λ“œ 왕이 될거야"

profile on loading

Loading...