4足歩行ロボットのしぐさ。
月: 2012年12月
inputに入力された内容によってactionのURLを変更する必要があり、調べた結果次のようにするとうまく動きました。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
function check() {
//alert(document.ansform.ans.value);
if (document.ansform.ans.value == "テキストの内容") {
document.ansform.action="http://google.co.jp/";
document.ansform.submit(); // ←なくても動作した
}
else
{
document.ansform.action="http://yahoo.co.jp/";
document.ansform.submit(); // ←なくても動作した
}
}
-->
</script>
</head>
<body>
<form name="ansform" method="get" onsubmit="check()">
<input name="ans" type="text" value="" />
<input type="submit" value="送信" />
</form>
</body>
</html>
Lunuxのエディタ「vim」では、標準の状態では全角の記号(■など)が半角分欠けて表示される。
欠けないようにするためには、以下の設定を追加する。
$ vi ~/.vimrc
:set ambiwidth=double
#↑を追加。
Ubuntuでapache2のrewriteを有効にする作業をしたのでメモ。
# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
# service apache2 restart
# vi sites-available/default
※rewrite の設定内容は割愛します。
# service apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
最近のコメント