Javascript

Chrome Bug - Location.reload() 호출 시 Form 데이터가 초기화 되는 문제

by kay posted Jan 14, 2014
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

크롬에서 Submit() 되어 Form 방식으로

넘어온 데이터가 페이지를 Reload() 하게 되면 사라지는 크롬만의 버그!!!.


몇년된 버그라고 하는데 그닥 고쳐지지 않고 있습니다.


임시방편은 GET 방식으로 값을 받거나 

Reload 대신 다시 폼을 구성하여 다시 Submit() 하는 방법정도...


Test Url : http://www.uhoon.co.kr/test/2514.asp 

 : Submit() 후 Reload 하면 값이 사라집니다.


<!DOCTYPE html>
<html>
<head>
	<title>Chrome Bug - Reload()</title>
	<script src="http://code.jquery.com/jquery-latest.min.js"></script>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<script type="text/javascript">
<!--
$(function() {
	$("#btnReload").on("click",function(){
		location.reload();
	});
});
//-->
</script>
</head>
<body >
<div>
	<form method="post" action="2514.asp" name="frmTest">
		<label for="Data">Send Data:</label>
		<br/>
		<input type="text" name="A" value="AAA"/>
		<input type="text" name="B" value="BBB"/>
		<input type="text" name="C" value="CCC"/>
		<br/>
		<br/>
		<label for="Data">Request Data:</label>
		<br/>
		<textarea id="formData" rows="5" cols="50"><%=Request.Form%></textarea>
		<input type="submit" />
		<input type="button" value="reload" id="btnReload"/>
	</form>
</div>
</body>
</html>


참고 Url : 

https://code.google.com/p/chromium/issues/detail?id=6429

https://bugs.webkit.org/show_bug.cgi?id=23735

http://stackoverflow.com/questions/13476006/javascript-location-reload-is-losing-post-data

TAG •

Articles

1 2