채택완료

ajax 레이어팝업 샘플이라는데....맞는건지? 문의드립니다.

2015-10-06 (화) 19:32:11 12,958

a.jsp 파일에서 버튼을 클릭시 b.jsp 파일을 불러와 레이어 형식으로 팝업을 띄울려고 한다는 문의사항에 대해

아래와 같은 답변이 지식인에 있더군요

 

그런데 b.jsp라는 것은 

load.('다른파일',.... ===>  load.('http://www.naver.com',.....

 

이렇게 코딩을 하면 되는건지...

 

녹색의 레이어팝업되는 부분에 naver화면이 떠야 하는거 같은데

아무것도 안나와서.

 

 

Copy
<!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>

답변 2개

채택된 답변
+20 포인트
2015-10-06 (화) 23:17:35
http://api.jquery.com/load/
중간쯤에 샘플소스를 참고하세요

글쌔요 언어는 비슨하다고해도  php 그누보드 인데 jsp 질문이,, 

답변을 작성하려면 로그인이 필요합니다.