Javascript/Javascript+jQuery
jquery POST 방식으로 다른 페이지로 이동하는 방법
자연코딩
2018. 4. 13. 14:49
반응형
<a id="btnList" href="#">리스트보기</a>
$(document).ready(function(){
$("#btnList").click(function(){
var form = document.createElement('form');
var objs;
objs = document.createElement('input');
objs.setAttribute('type', 'hidden');
objs.setAttribute('name', 'name');
objs.setAttribute('value', value);
form.appendChild(objs);
form.setAttribute('method', 'post');
form.setAttribute('action', "/action.php");
document.body.appendChild(form);
form.submit();
});
});
출처: http://waqoon.tistory.com/185 [와쿤의 IT 이야기]
출처: http://waqoon.tistory.com/185 [와쿤의 IT 이야기]
반응형