Develop/JavaScript JQuery JSP

0704 Popup과 리턴 데이터

포페PostFace 2022. 7. 4. 18:43
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function openWin() {
		window.open('Ex03_popup.html','popup','width=450 height=700')
	}
</script>

</head>
<body>
	<form name='myform'>
		<input type='text' name='id' value='ID'><br>
		<input type='text' name='password' value='Password'><br>
		
		<input type='button' value='팝업창열기' onClick="openWin()">		
	</form>

</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ex03_popup.html</title>
<script type="text/javascript">
	function receiver(){
		window.myform.id.value=window.opener.myform.id.value;
		window.myform.password.value=window.opener.myform.password.value;
	}
	function closeButton(){
		opener.myform.id.value=myform.id.value;
		opener.myform.password.value=myform.password.value;
		self.close();
	}
</script>
</head>
<body onLoad="receiver()">
<img src='../images/pop1.jpg'> <br>
	<form name='myform'>
		<input type='text' name='id' value='아이디'><br>
		<input type='text' name='password'><br>
		
		<input type='button' value='닫기' onClick='closeButton()'>		
	</form>
</body>
</html>
Insert title here


Ex03_popup.html


'Develop > JavaScript JQuery JSP' 카테고리의 다른 글

0704 시간 띄우고 인터벌로 갱신하기  (0) 2022.07.04
0704 PopUp과 리턴데이터 활용  (0) 2022.07.04
0704 이중배열  (0) 2022.07.04
0630 배열  (0) 2022.07.04
0630 for문을 통해 구구단 테이블 만들기  (0) 2022.07.04