現在、固定のURLに値を結合し、それにアクセスするものを作っています。
alert("action=" + document.fm.getAttribute("action"));にて、
formタグのactionにactionurlが格納されているのを確認しているのですが、
document.fm.submit();では"?" + hashがない http://exsample.com/& にアクセスします。
※「"?"」は?です。
submitの仕方が間違っていたりするのでしょうか?ご教示願います。
HTML
1<html> 2<head> 3<title>Login</title> 4 <script type="text/javascript"><!-- 5 getHash = function() { 6 var hashTabName = document.location.hash; 7 var hash = hashTabName.replace(/#/g,''); 8 var actionurl = "http://exsample.com/" + "?" + hash; 9 document.fm.setAttribute("action",actionurl); 10 alert("action=" + document.fm.getAttribute("action")); 11 document.fm.submit(); 12 13 }; 14 // --></script> 15</head> 16<body> 17<form name="fm" action="" method="get"> 18</form> 19</body> 20<script> 21getHash(); 22</script> 23</html> 24