私は次のようなhtmlを持っています:
<!doctype html>
<html manifest="">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<div data-role="page" id="Find">
<div data-theme="b" data-role="header" data-position="fixed">
<h3>test</h3>
</div>
<div data-role="content">
<form action="handler.php" id="findForm" >
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="textinputf1"> keyword: </label> <input id="textinputf1" name="keyword" placeholder="" value="" type="text" />
</fieldset>
</div>
<input type= "submit" data-theme="g" value="Find" />
</form>
</div>
</div>
<div data-role="page" id="Results">
<div data-theme="b" data-role="header" data-position="fixed">
<h3>Results</h3>
</div>
<div data-role="content">
<ul data-role="listview" data-filter="true">
<li><a href="">HEllo</a></li>
<li><a href="">Bye</a></li>
</ul>
</div>
</div>
</body>
</html>
次のような handler.php:
<?php
//...
if( let's say false ) {
header("location:.");
}else{
header("location:./#Results");
//header("Refresh:0;url=/application/test/#Results");
}
header+refresh または header+location を使用して、フォームを送信すると、URL バーに次のように表示されます: .../handler.php?keyword=test
しかし、リダイレクトされず、ページを更新すると (URL バーから Enter キーを押すか、F5 を押す)、#Results が表示されますが、自動的には表示されません。
それを修正する方法はありますか?