ajax 레이어팝업 샘플이라는데....맞는건지? 문의드립니다.
본문
a.jsp 파일에서 버튼을 클릭시 b.jsp 파일을 불러와 레이어 형식으로 팝업을 띄울려고 한다는 문의사항에 대해
아래와 같은 답변이 지식인에 있더군요
그런데 b.jsp라는 것은
load.('다른파일',.... ===> load.('http://www.naver.com',.....
이렇게 코딩을 하면 되는건지...
녹색의 레이어팝업되는 부분에 naver화면이 떠야 하는거 같은데
아무것도 안나와서.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>다른 파일을 불러와 레이어 팝업 띄우기</title>
<script src="//code.jquery.com/jquery-1.11.3.js"></script>
<script>
$(document).ready(function(){
$('#btn_layerPopup').click(function(){
$('#layerPopup_content').load('다른파일', function(){
$('#layerPopup').show();
});
});
$('#btn_layerPopup_hide').click(function(){
$('#layerPopup').hide();
});
});
</script>
</head>
<body>
<div id="layerPopup" style="position:absolute; z-index:10; width:500px; height:500px; left:50%; top:50%; margin-left:-250px; margin-top:-250px; background-color:green; display:none;">
<div id="layerPopup_content"></div>
<button type="button" id="btn_layerPopup_hide">팝업닫기</button>
</div>
<button type="button" id="btn_layerPopup">팝업보기</button>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
html영역입니다.<br>
<a href="http://www.naver.com">네이버으로 이동하기</a></br>
<a href="http://www.naver.com">네이버으로 이동하기</a></br>
<a href="http://www.naver.com">네이버으로 이동하기</a></br>
</body>
</html>
답변을 작성하시기 전에 로그인 해주세요.